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, 15 years, 1 month 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, 15 years, 1 month 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, 15 years, 1 month 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, 15 years, 1 month ago
No, it is not possible to read the JPEG quality setting with which the image has been compressed. See for instance hereReply
Re: Changed picture has more bytes than the original one new!
by MelnykLarysa, 3 months ago
Thanks, Colin. That makes sense. I was hoping there might be a way to reverse-engineer the quality setting, but I see now it's not stored in the JPEG metadata. Appreciate the clarification and the linkReply