class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Great Coding and class, i use this upload class lots. I love the idea of the new feature image_auto_rotate, but am having the below issues with it
I have tried several different images (taken on a Samsung s7), but all fail with a server time out error (maximum execution time). If i add $handle->image_auto_rotate = false; all then works well, but does not rotate the image (if it needs rotating)
Below is the code i am using:
//** ============ images sizes ===============
// small thumb
$imageSize_arr[] = array('image_resize' => true, 'image_x' => THUMBNAILWidth, 'image_ratio_y' => true, 'jpeg_quality' => 80, 'image_unsharp_amount' => 80, 'file_name_body_add' => '_thumb');
// normal thumb
$imageSize_arr[] = array('image_resize' => true, 'image_x' => THUMBNAILWidthLARGE, 'image_ratio_y' => true, 'jpeg_quality' => 80 , 'image_unsharp_amount' => 80, 'file_name_body_add' => '_largethumb');
// full size image
$imageSize_arr[] = array('image_resize' => true, 'image_x' => IMAGEWidth, 'image_ratio_y' => true, 'jpeg_quality' => 80, 'image_unsharp_amount' => 80);
//origional file
$imageSize_arr[] = array('image_resize' => false, 'file_name_body_add' => '_origional');
$handle = new upload($file); // initiate upload class
$fileName = urlencode(md5($handle->file_src_name.uniqid(true).time())); // genrate a unique file name
if ($handle->uploaded) {
foreach ($imageSize_arr as $size_arr){
$handle->file_new_name_body = $fileName;
$handle->file_overwrite = true;
$handle->file_max_size = MAX_BYTE_IMAGE_SIZE;
$handle->allowed = array('image/*');
//$handle->image_auto_rotate = false;
foreach($size_arr as $key=>$value){
$handle->$key = $value;
}
$handle->process(REVIEW_GALLERY_FULL_IMAGE_PATH.$reviewID.'/');
}
// check if all went well
if ($handle->processed) {
$handle->clean();
}
}
Any help would be much appreciated. (i think how it rotates needs looking at as it loops for too long if the images being uploaded is large (the images i am testing with are around 8MB))
I love the idea of the new feature image_auto_rotate, but am having the below issues with it
I have tried several different images (taken on a Samsung s7), but all fail with a server time out error (maximum execution time).
If i add $handle->image_auto_rotate = false; all then works well, but does not rotate the image (if it needs rotating)
Below is the code i am using:
Any help would be much appreciated.
(i think how it rotates needs looking at as it loops for too long if the images being uploaded is large (the images i am testing with are around 8MB))
Thanks
Jon