Extra Characters in UserComment

Started by Archive, May 12, 2010, 08:53:49 AM

Previous topic - Next topic

Archive

[Originally posted by nick on 2005-06-09 08:45:08-07]

Hi,

I only found this great tool yesterday, so perhaps this question is easily answered. I have a lot of JPEG files (from a FujiFilm camera) with no comments in them, but with comments in text files. I have used Image-ExifTool to set the UserComment in the EXIF group to the contents of the text file. Most of the time this works ok, but sometimes I get extra characters on the end of the comment (0F 0D 0A in hex). These characters are only visible in my html album created by JAlbum, and other tools seem to read the UserComment ok.

When I run Image-ExifTool to do this (using exiftool "-UserComment&lt=file.txt" -P file.jpg) I get the error "Warning: InteropOffset tag out of sequence in ExifIFD - file.jpg". Transferring the text to Comment instead seems to work fine for all images, but I need it in UserComment for compatability with other software.

Could this be due to an unknown format in Fuji EXIF data?

Nick

Archive

[Originally posted by nick on 2005-06-09 10:24:05-07]

I've just answered my own question! It turns out that I need an ASCII 0 at the end of the file file.txt. I guess that this is only required for some files because the writing of the UserComment is normally overwriting 0's anyway. I see that the null terminator was removed in version 5.17.

I still get that warning though, even though everything appears to be ok.

If you would find it useful to have a test image let me know.

Nick

Archive

[Originally posted by exiftool on 2005-06-09 11:33:06-07]

Hi Nick,

The null terminator was removed from the JPEG Comment (the COM segment), NOT the EXIF UserComment.  The UserComment should absolutely NOT require a null terminator (See EXIF 2.2 specification, page 29: "UserComment [...] Since the TYPE is not ASCII, NULL termination is not necessary").  If JAlbum requires this, please submit a bug report to them.

Another possible problem are invisible characters in your text file.  Use "exiftool -v3" to display the EXIF information in hex form, and make sure the UserComment contains what you wanted (Note: The UserComment begins with the byte sequence "ASCII\0\0\0" according to the EXIF specification.)

If you can, show me the output from "exiftool -v3" for an image giving this problem.  ie)

Code:
 | | 2)  UserComment = ASCIImy user comment
  | |     - Tag 0x9286 (23 bytes, undef[23]):
  | |         009c: 41 53 43 49 49 00 00 00 6d 79 20 75 73 65 72 20 [ASCII...my user ]
  | |         00ac: 63 6f 6d 6d 65 6e 74                            [comment]

The warning you observed with out of sequence IFD entries has been observed with some digital cameras.  The EXIF (and TIFF) specs state that the IFD entries must be in numerical order.  ExifTool 5.26 (available from my web site) adds the feature that the IFD's are sorted into the proper sequence if this problem is detected when writing.

Archive

[Originally posted by nick on 2005-06-09 12:18:23-07]

Hi Phil,

Thanks for that. I think I will submit a bug report to JAlbum. Anyway, here's the output of "exiftool -v3" for a problematic image:

Code:
 | | 17) UserComment = ASCIIMacro test
  | |     - Tag 0x9286 (18 bytes, undef[18]):
  | |         03ce: 41 53 43 49 49 00 00 00 4d 61 63 72 6f 20 74 65 [ASCII...Macro te]
  | |         03de: 73 74                                           [st]

It all appears ok, but in my html album the comment is shown as "Macro test,.", i.e. with characters 2C 0F on the end (I replaced the last character with "." so that this message would be accepted).

With regards the warning, I'll try out the latest version. I only downloaded 5.25 yesterday!

Nick