LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

php function after upload #158

Open trinzia opened 8 years ago

trinzia commented 8 years ago

Hi, I'm attempting to add a thumbnail after the upload succeeds. For example, I would like to collect image.png, then create also image_80x80.png, image_160x160.png (etc).

I tried adding functions both in file_upload.php and in Uploader.php (right before the return true at the end:

 if ( $this->savedFile ) {

 $im = new imagick( $this->fileName );

 $im->cropThumbnailImage( 80, 80 );

 $im->writeImage( $this->uploadDir . $this->fileNameWithoutExt . "_80x80" . $this->fileExtension ); 

 }

Should this work ? Where should I put such a function?