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. Quote 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). Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.