Jump to content

image save as with a lower quality


ted_chou12

Recommended Posts

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);

Link to comment
https://forums.phpfreaks.com/topic/215089-image-save-as-with-a-lower-quality/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.