mr_sarge Posted February 25, 2006 Share Posted February 25, 2006 I have this simple code that I've found in the php manuel to resize image. I work great, but if the image is too big, script crash and wont resize the image. I have set a limit to 1280x1024 since all that is bigger than this crash.I don't know if it's the image file size in kb or it's dimension, but what can I do?[code]// Get new sizes for thumblist($width, $height) = getimagesize($prod_img);$newwidth = "200";$newheight = "150";// Load$thumb = imagecreatetruecolor($newwidth, $newheight);$source = imagecreatefromjpeg($prod_img);// Resizeimagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);// Outputimagejpeg($thumb, $prod_img_thumb);[/code] Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/ Share on other sites More sharing options...
hitman6003 Posted February 25, 2006 Share Posted February 25, 2006 What exact error are you getting?Offhand, it could be a couple of things...1. The file you are uploading is too big and doesn't get uploaded. By default, the limit is set to 2048kb.2. The script is using too much memory. I've encountered this before when working with very large jpgraph graphs. By default a script is limited to occupying 8MB (maybe 16, but I think 8) of memory, if you have a very large pic, then as it's doing it's resizing functions on it, it may be going above that. Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/#findComment-12456 Share on other sites More sharing options...
mr_sarge Posted February 25, 2006 Author Share Posted February 25, 2006 the file that I am trying to upload and resize is 900kb 2272x1704the file is uploaded, I can see it and open it on the server manually.When the scrypt try to resize it, notting append. the html page that I should see with a "correct" confirmation is not display.My page is look this:HeaderMenuPHP SCRIPT TO RESIZEPHP SCRIPT THAT CONFIRM THAT ALL IS OKsome linkfooterIs image is less than 500kb all of this is ok. If I try my 900kb image, html page stop after the menu part. my link and footer are not displayed and in the source, tha table aren't close !! Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/#findComment-12460 Share on other sites More sharing options...
hitman6003 Posted February 25, 2006 Share Posted February 25, 2006 [!--quoteo(post=349366:date=Feb 25 2006, 03:31 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Feb 25 2006, 03:31 PM) [snapback]349366[/snapback][/div][div class=\'quotemain\'][!--quotec--]What exact error are you getting?[/quote]Turn on error reporting if necessary:[code]ini_set("error_reporting", "1");ini_set("display_errors", "E_ALL");[/code] Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/#findComment-12461 Share on other sites More sharing options...
mr_sarge Posted February 25, 2006 Author Share Posted February 25, 2006 nothing is display with this code on when I upload a big file... Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/#findComment-12462 Share on other sites More sharing options...
Crew-Portal Posted May 2, 2008 Share Posted May 2, 2008 wow this topic sure is OLD. But sadly its still unsolved! ;D Link to comment https://forums.phpfreaks.com/topic/3587-imagecopyresampled-size-limitation/#findComment-531932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.