when i read a jpeg image using Magick::readImages(...) function. how can i know the estimated jpeg quality of the image ? i know how to set the quality when i wanna write the image, but it is not relevant to the quality of the original image, so for example: when I read an jpeg image that its quality is 80% and I write it using 90% quality I will get a bigger image than the original one, since the 90% is not 90% out of the original 80%. How can I know the jpeg quality of the read image ?
+3
A:
This is impossible, period. The JPEG quality settings is just a number that is passed to the encoder and affects how the encoder treats the data.
It's not even percentage of anything - it is just some setting that affects how aggressively the encoder manipulates and transforms data. Wherever you see the percent sign near JPEG quality just ignore it - it's meaningless there.
So regardless of the encoder it is impossible to find which JPEG quality settings value the enocder used to produce this very image. The only way would be to obtain the original and try all reasonably possible setting values until you hit the same result.
sharptooth
2010-05-03 13:22:19
Translated: The value you want is not stored within the JPEG file itself.
Billy ONeal
2010-05-03 15:38:57
@Billy ONeal. Not only that. The "quality" range might be different depending on the encoder - some encoder might have a range from 52 to 650, so in order to be able to do something reasonable one has to know both the encoder version and the value. The latter two are highly unlikely to be stored explicitly in the produced file.
sharptooth
2010-05-03 15:42:18