Trium918 Posted May 28, 2007 Share Posted May 28, 2007 Can someone help with this Thanks? Why the image isn't show up? <?php if (!$max_width) $max_width = 80; if (!$max_height) $max_height = 60; $size = GetImageSize($image); $width = $size[0]; $height = $size[1]; $x_ratio = $max_width / $width; $y_ratio = $max_height / $height; if ( ($width <= $max_width) && ($height <= $max_height) ) { $tn_width = $width; $tn_height = $height; } else if (($x_ratio * $height) < $max_height) { $tn_height = ceil($x_ratio * $height); $tn_width = $max_width; } else { $tn_width = ceil($y_ratio * $width); $tn_height = $max_height; } $src = imagecreatefromjpeg($image); $dst = imagecreate($tn_width,$tn_height); imagecopyresized($dst, $src, 0, 0, 0, 0, $tn_width,$tn_height,$width,$height); header("Content-type: image/jpeg"); imagejpeg($dst, null, -1); imagedestroy($src); imagedestroy($dst); ?> picture.php <?php echo "<IMG SRC=\"resize_image.php?image= 3b.jpg\">"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/53318-solved-image-resize-help-image-isnt-showing-up-why/ Share on other sites More sharing options...
Trium918 Posted May 29, 2007 Author Share Posted May 29, 2007 Textbox post here if you have any question! Quote Link to comment https://forums.phpfreaks.com/topic/53318-solved-image-resize-help-image-isnt-showing-up-why/#findComment-263574 Share on other sites More sharing options...
penguin0 Posted May 29, 2007 Share Posted May 29, 2007 why is there a space? = 3b.jpg Quote Link to comment https://forums.phpfreaks.com/topic/53318-solved-image-resize-help-image-isnt-showing-up-why/#findComment-263580 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.