avvllvva Posted October 20, 2008 Share Posted October 20, 2008 I have tried to resize 3000*3000 resolution images using normal functions in php. In local server it was resized perfectly but in online server it was not working, at there maxium resized resolution was 1600*1500. Could anybody help me to fix this ......? Quote Link to comment Share on other sites More sharing options...
aximbigfan Posted October 20, 2008 Share Posted October 20, 2008 Please post your code! Chris Quote Link to comment Share on other sites More sharing options...
avvllvva Posted October 20, 2008 Author Share Posted October 20, 2008 function PL_CJimageresize($filepath,$filename,$id,$uploaddir,$wide,$long,$table,$field,$extension){ list($width, $height) = getimagesize($filepath); if($width>$wide) $new_width = $wide; else $new_width = $width; if($height>$long) $new_height = $long; else $new_height = $height; // ______________________________Resample________________________________________________ $image_p = imagecreatetruecolor($new_width, $new_height); if($extension=="jpeg" || $extension=="jpg" || $extension=="JPG" || $extension=="JPEG" ){ $image = imagecreatefromjpeg($filepath); } else if($extension=="gif"){ $image = imagecreatefromgif($filepath); } else if($extension=="png"){ $image = imagecreatefrompng($filepath); } imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //_______________________________Output destination file_____________________________________ $newname =$uploaddir.$filename; if($extension=="jpeg" || $extension=="jpg"){ imagejpeg($image_p, $newname); } else if($extension=="gif"){ imagegif($image_p, $newname); } else if($extension=="png" || $extension=="PNG"){ imagepng($image_p, $newname); } } Quote Link to comment Share on other sites More sharing options...
avvllvva Posted October 22, 2008 Author Share Posted October 22, 2008 I have tried to resize 3000*3000 resolution images using normal functions in php. In local server it was resized perfectly but in online server it was not working, at there maxium resized resolution was 1600*1500. Could anybody help me to fix this ......? function PL_CJimageresize($filepath,$filename,$id,$uploaddir,$wide,$long,$table,$field,$extension){ list($width, $height) = getimagesize($filepath); if($width>$wide) $new_width = $wide; else $new_width = $width; if($height>$long) $new_height = $long; else $new_height = $height; // ______________________________Resample________________________________________________ $image_p = imagecreatetruecolor($new_width, $new_height); if($extension=="jpeg" || $extension=="jpg" ){ $image = imagecreatefromjpeg($filepath); } else if($extension=="gif"){ $image = imagecreatefromgif($filepath); } else if($extension=="png"){ $image = imagecreatefrompng($filepath); } imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //_______________________________Output destination file_____________________________________ $newname =$uploaddir.$filename; if($extension=="jpeg" || $extension=="jpg"){ imagejpeg($image_p, $newname); } else if($extension=="gif"){ imagegif($image_p, $newname); } else if($extension=="png" || $extension=="PNG"){ imagepng($image_p, $newname); } } Quote Link to comment Share on other sites More sharing options...
avvllvva Posted October 22, 2008 Author Share Posted October 22, 2008 Please post your code! Chris Is it any server settings in php.ini? But I have compared the local ini file with the server it was same. where is the problem? working in local not in server .....please help. Quote Link to comment Share on other sites More sharing options...
aximbigfan Posted October 22, 2008 Share Posted October 22, 2008 This function should work the same on both ends. Are the versions of PHP different? What about the GD lib? Chris Quote Link to comment Share on other sites More sharing options...
avvllvva Posted October 23, 2008 Author Share Posted October 23, 2008 This function should work the same on both ends. Are the versions of PHP different? What about the GD lib? Chris Server php version is 5.1.6, local is 5.2.0. GD lib is enabled and both having same version Ver. 2.0 Quote Link to comment Share on other sites More sharing options...
aximbigfan Posted October 25, 2008 Share Posted October 25, 2008 Have you checked PHP.ini for any GD settings? I'm not really familiar with how GD works, so I'm kinda shootign in the dark here. Chris Quote Link to comment Share on other sites More sharing options...
corbin Posted October 25, 2008 Share Posted October 25, 2008 Most likely the script is running out of memory. Quote Link to comment Share on other sites More sharing options...
avvllvva Posted October 26, 2008 Author Share Posted October 26, 2008 Most likely the script is running out of memory. Could you please suggest a solution for that... Quote Link to comment Share on other sites More sharing options...
Twister1004 Posted October 26, 2008 Share Posted October 26, 2008 You can't really suggest anything for running out of memory, other than making more space. Running out of memory is basically where you can not add anything else to your website hoster. Quote Link to comment Share on other sites More sharing options...
avvllvva Posted November 11, 2008 Author Share Posted November 11, 2008 You can't really suggest anything for running out of memory, other than making more space. Running out of memory is basically where you can not add anything else to your website hoster. Anyway I left it..........thanks for help. Quote Link to comment 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.