"Only Shrink Larger Images" also modifies smaller images"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
inigomena

"Only Shrink Larger Images" also modifies smaller images"

Post by inigomena »

Hi
What do you think about this?:
http://redux.imagemagick.org/discourse- ... =1&t=10996
I think the convert or mogrify commands should not rewrite the file if they are not modifying the image.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Only Shrink Larger Images" also modifies smaller images"

Post by magick »

Some users may only change image metadata such as a comment or color profile, for example, and still want the image written even though the pixels have not been modified. Or perhaps they may want the image file timestamp updated. We could introduce an option to permit either behavior and add a bunch a code to track to see if any of the hundreds of image properties or pixels have changed and ensure if the image is part of a sequence that none of the images in the sequence have been modified. However, we think the right thing to do is to reserve these forms of specialized workflow for shell scripts (e.g. bash) or one of the many scripting language (e.g. IMagick for PHP) or programming languages (.e.g. MagickWand for C) that interface with ImageMagick.
inigomena

Re: "Only Shrink Larger Images" also modifies smaller images"

Post by inigomena »

Hi, I agree that the program rewrites the file, but I think it should only recompress the picture if it is necessary, so, in your example, if you are going to change the metadata you should not have a quality loss.
I have used a program named jhead to remove the metadata, it rewrites the file but the picture remains untouched (it is not decompressed and recompressed, so there is no quality loss). I think imagemagick should have a similar behaviour, so if it is not necessary to modify the picture, the jpeg part of it should not be altered.
Post Reply