How to resize images before upload to server


I’m new in scriptcase and I need to resize images for a form before them upload to the server, i’m trying to use the “wideimage” ( library but it dont work i spected.

Here is the code i use on the “onBeforeInsert” event.

Image Field name: ImageName

sc_include_library(“prj”, “wideimage”, “WideImage.php”, true, true);
$image = WideImage::load({ImageName});
$resized = $image->resize(1280, 1280);
$img_resized = $resized->asString(‘jpg’, 80);
{ImageName} = $img_resized;

If are other solution to this problem please share me!


any luck?
if you solved please shere it… i am searching just the same stuff