On 08/01/2011 03:23 AM Anthony Thyssen wrote:
> On Fri, 29 Jul 2011 12:46:45 -0400
> magick-developers-boun...@imagemagick.org wrote:
> | Why is it, when I insert a short comment in a jpeg, that the size of the
> | resulting jpeg file increases so much?  E.g.,
> | 
> | $ stat --format="%n %s" test.jpg ; convert -comment "This is a comment
> | inserted by me." test.jpg test1.jpg; stat --format="%n %s" test*.jpg
> | test.jpg 3460012
> | test1.jpg 3471325
> | test.jpg 3460012
> | 
> | The comment inserted is a mere 34 characters.  The increase in the file
> | size, however, is 11313 bytes.
> | 
> | Moreover, if I then change the comment to some other text which is
> | exactly the same length, the size of the file increases quite radically
> | again.  Why does this happen?
> | 
> | 
> | Thanks much for your enlightenment.
> | ken
> | 
> 
> Because IM will read in a JPEG and write it out again.
> 
> It is a general image processor.
> 
> http://www.imagemagick.org/Usage/formats/#jpeg

Thanks for the reply.  Yes, obviously IM reads a jpeg and writes it out
again.  I was able to discern that from the fact that prior to running
the convert command I had one file and afterwards I had two files.  But
this explains nothing.

Let me see if I can clarify my question a bit more....

The jpg image comes directly from my camera.  I want to insert a comment
into that image, nothing else.  I don't want to change the image at all.
 I want to leave the image from the camera just as it is.  I don't want
to "improve" the image or make it bigger or smaller.  I don't want to
upgrade the version.  I just want to insert a comment-- a comment and
nothing else.  If the comment I insert is 34 characters, I would expect
that the jpg which is written out to be, at most, 34 characters larger
than the original,  But it's more that eleven thousand bytes larger.
Obviously more has happened to this file than the insertion of 34
characters.

But the IM command I ran is meant to insert a comment-- and do nothing
else.  At least that is what the documentation states.  Or is there some
other command I should use to insert a comment without adding or
changing anything else...?


-- 
"When a society comes together and makes decisions in harmony,
when it respects its most noble traditions, cares for its most
vulnerable members, treats its forests and lands with respect,
then it will prosper and not decline."
        --Buddha, Mahaparinirvana Sutra
_______________________________________________
Magick-developers mailing list
Magick-developers@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-developers

Reply via email to