Lodius2000 Posted July 19, 2008 Share Posted July 19, 2008 Hi my image resizer works fine if the image is a horizontal but not a vertical attached are what the input and output looks like, 071808_08orig.jpg turns into 071808_08sm.jpg <?php $src_sm = imagecreatefromjpeg($uploadedfile); //$uploadedfile comes from a form $sm_pixels = 250; $sm_height = 250; // Get dimensions of original list($width_orig, $height_orig) = getimagesize($uploadedfile); if ($width_orig >= $height_orig) { //this is for horizontal resizement and works fine, so code is omitted } else { $new_sm_width=($width_orig/$height_orig)*$sm_pixels; $tmp_sm=imagecreatetruecolor($new_bg_width,$sm_height); imagecopyresampled($tmp_sm,$src_sm,0,0,0,0,$new_sm_width,$sm_height,$width_orig,$height_orig); } //$filename_sm contains a path and filename to be saved imagejpeg($tmp_sm,$filename_sm,100); ?> so what am i doing wrong, the vertical dimension is right, 250, but the horizontal dimension is 341, where is that coming from thanks [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/115543-solved-image-resize-problems/ Share on other sites More sharing options...
Lodius2000 Posted July 20, 2008 Author Share Posted July 20, 2008 bump thanks Link to comment https://forums.phpfreaks.com/topic/115543-solved-image-resize-problems/#findComment-594993 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.