kev wood Posted May 20, 2008 Share Posted May 20, 2008 i have created an image upload system for a website it works fine the image are uploaded and resized. but if an image is uploaded which is bigger than 1000px wide the thumbnail is not created. the max size defined for the thumbnails is 200*200px. the code i have used to create the new dimensions is this $ratio1=$old_x/$new_w; $ratio2=$old_y/$new_h; if($ratio1>$ratio2) { $thumb_w=$new_w; $thumb_h=$old_y/$ratio1; } else { $thumb_h=$new_h; $thumb_w=$old_x/$ratio2; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); and the code i have used to resize the original image is this imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); i will post the errors shortly. if i work out why it not doing it i will post the answer. Quote Link to comment https://forums.phpfreaks.com/topic/106454-solved-image-upload-problem/ Share on other sites More sharing options...
MadTechie Posted May 20, 2008 Share Posted May 20, 2008 its probably timeing out, try adding this to the start <?php error_reporting(E_ALL); //<-- should report errors now set_time_limit(0);// <-- no time out limit (lol, yeah right) ?> Quote Link to comment https://forums.phpfreaks.com/topic/106454-solved-image-upload-problem/#findComment-545666 Share on other sites More sharing options...
GingerRobot Posted May 20, 2008 Share Posted May 20, 2008 Or possibly exceeding one of the other relevant resource restrictions (file size, etc). i will post the errors shortly Why not post the errors now? Quote Link to comment https://forums.phpfreaks.com/topic/106454-solved-image-upload-problem/#findComment-545671 Share on other sites More sharing options...
kev wood Posted May 20, 2008 Author Share Posted May 20, 2008 i didnt post the errors as they will not come back. typical i got someone else to test it and the errors came up. they wrote down what they did and on what page and it will not happen for me. still trying to get them to come back. i will try the time out as it was taking a while for the image to be uploaded due to the size prob. Quote Link to comment https://forums.phpfreaks.com/topic/106454-solved-image-upload-problem/#findComment-545683 Share on other sites More sharing options...
kev wood Posted May 20, 2008 Author Share Posted May 20, 2008 it looks like the time out was the problem it is making any size image (as long as it not bigger than 1MB) into a thumbnail image. thanks for the reply. Quote Link to comment https://forums.phpfreaks.com/topic/106454-solved-image-upload-problem/#findComment-545712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.