johnsmith153 Posted August 20, 2010 Share Posted August 20, 2010 (1) What does this actually do? (compress it?) $image = imagecreatefromjpeg("image.jpg"); header('Content-Type: image/jpeg'); imagejpeg($image); By using this rather than displaying by using www.site.com/image.jpg it reduces file size of an image from 2.5mb to 0.5mb !! (2) ImageMagick can't get these results. Am I doing something wrong? If I change the pixel size of an image in ImageMagick then I can reduce its file size, but (1) above reduces file size regardless of changing pixel size. Link to comment https://forums.phpfreaks.com/topic/211239-image-size-imagemagick-photo-upload/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 20, 2010 Share Posted August 20, 2010 From the documentation for the function you are using - imagejpeg ... quality quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default is the default IJG quality value (about 75). Link to comment https://forums.phpfreaks.com/topic/211239-image-size-imagemagick-photo-upload/#findComment-1101498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.