Rochtus Posted June 21, 2009 Share Posted June 21, 2009 I don't know what is wrong:s It doesn't give a error it doesn't display anything <?php ob_start(); $filename = "../images/pics/SP_A0002.jpg"; // Set a maximum height and width $width = 200; $height = 200; // Content type header('Content-type: image/jpeg'); // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename); $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagejpeg($image_p, null, 100); ob_end_clean(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/163140-mistake-in-resize-script/ Share on other sites More sharing options...
sellfisch Posted June 21, 2009 Share Posted June 21, 2009 You are cleaning the whole output in the end. so there is nothing to display. // Output imagejpeg($image_p, null, 100); ob_end_clean(); i think its the best to leave this buffering out Quote Link to comment https://forums.phpfreaks.com/topic/163140-mistake-in-resize-script/#findComment-860718 Share on other sites More sharing options...
wildteen88 Posted June 21, 2009 Share Posted June 21, 2009 @Rochtus: Please use code tags ( ) when posting any code. Quote Link to comment https://forums.phpfreaks.com/topic/163140-mistake-in-resize-script/#findComment-860725 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.