I just tried out opening a jpeg with a text editor (vim), and changing
the comment manually.  This works fine if you make the new comment the
same length as the old one.  If the new comment is longer, a warning
is issued when opening about extraneous bytes, and if the new comment
is smaller it doesn't open.  This can be fixed by opening with a hex
editor, and changing the byte before the comment:
xxd myfile.jpg > myfile.hex 
change the line:
0000010: 0048 0000 fffe 0007 4865 6c6c 6fff db00  .H......Hello...
0000010: 0048 0000 fffe 0004 4865 6c6c 6fff db00  .H......Hello...
convert back to binary: 
xxd -r myfile.hex > myfile.jpg 
Then change "Hello" to "Hi" with a text editor like vim.
And I figured that out without even looking at the documentation!  I
bet it would only take a little C to make an automated jpeg comment
changer.  Oh, and upon some looking around, there's one right on my 
system: wrjpgcom.  So read the man page on it and see if that's what
you want.
-James Smaby
Gimp-user mailing list

Reply via email to