Changed picture has more bytes than the original one

See all posts Reply

Changed picture has more bytes than the original one new!
by Douglas, 13 years, 5 months ago
Hello,

everytime I upload an Image and set the width/height smaller the result's physical size (bytes) gets higher than of the original image.

It also happens when i don't change the width/height.

But why?

Regards

DouglasReply
Re: Changed picture has more bytes than the original one new!
by colin, 13 years, 5 months ago
The image is decompressed by the class, and then recompressed. If it is a JPEG, you can change the setting jpeg_quality, which is set to 85 by default.

You may want to use a tool such as ImageMagick identify to compare the two images, and see why the resulting image is bigger in size.Reply
Re: Changed picture has more bytes than the original one new!
by Douglas, 13 years, 5 months ago
Thanks for the info.

Is it possible to "read" the compression rate of an uploaded image so i can use it for the setting jpeg_quality? For instance when I got a jpeg with a compression rate of 70% I don't want the Upload class to make 85% when it creates the result picture.Reply
Re: Changed picture has more bytes than the original one new!
by colin, 13 years, 5 months ago
No, it is not possible to read the JPEG quality setting with which the image has been compressed. See for instance hereReply