ted_chou12 Posted October 4, 2010 Share Posted October 4, 2010 Hi, I am tryng to use the gd functions in php to output an image of a lower quality and save it as another image: header('Content-Type: image/jpeg'); $im = @imagecreatefromjpeg('SDC10424.JPG'); imagejpeg($im, null, 50);// this line lowers the image quality imagedestroy($im); but the problem is how to save it? I tried file_put_contents, but it didnt work, like fileputcontents("test.jpg", $im); Quote Link to comment https://forums.phpfreaks.com/topic/215089-image-save-as-with-a-lower-quality/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 4, 2010 Share Posted October 4, 2010 Read the documentation for imagejpeg, particularly for the second parameter. Quote Link to comment https://forums.phpfreaks.com/topic/215089-image-save-as-with-a-lower-quality/#findComment-1118740 Share on other sites More sharing options...
ted_chou12 Posted October 4, 2010 Author Share Posted October 4, 2010 thanks Quote Link to comment https://forums.phpfreaks.com/topic/215089-image-save-as-with-a-lower-quality/#findComment-1118750 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.