Jump to content

Image Size / ImageMagick / Photo Upload


johnsmith153

Recommended Posts

(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

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

 

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.