How to resize images before upload to server

Greetings,

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” (http://wideimage.sourceforge.net/documentation/manipulating-images/) 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!

2 Likes

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

fer

Do you you solved, i need to do same things?

Hi, i need resize images before upload to server, with multi-upload Scriptcase.
my Users take photos hight resultion from mobiles, and they must upload their photos with multi-upload scriptcase

Any Idea how resize images before upload, how can do it?

As upload is a php function, there is not much you can do actually, at least not with the standard functionality of SC. There are alternative ways, but to my experience it might be hard to implement. But a good start might be: javascript - Use HTML5 to resize an image before upload - Stack Overflow

Thanks you Aducom,
We hope that SC TEAM will soon include new features in future versions for images.

You could have users resize their images here before uploading.

http://www.simpleimageresizer.com/