setImage(PATH_TMP.'original'.'.'.$fileExtension, PROFILE_WIDTH, PROFILE_HEIGHT, 'crop'); $Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, PROFILE_IMG_QUALITY, false, true); } // --- OTHERS --- else { // Generate the thumbnail $Image = new Image(); $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop'); $Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, THUMBNAILS_QUALITY, true); // Move the original to the upload folder. rename(PATH_TMP.'original'.'.'.$fileExtension, PATH_UPLOADS.$tmpName); } // Remove the Bludit temporary file. if(file_exists(PATH_TMP.'original'.'.'.$fileExtension)) { unlink(PATH_TMP.'original'.'.'.$fileExtension); } exit(json_encode(array( 'status'=>0, 'filename'=>$tmpName ))); ?>