commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Føns <>
Subject Re: [sanselan] Writing EXIF data to JPEG
Date Thu, 08 Mar 2012 16:39:04 GMT

> I wouldn't count on Windows Explorer to give you the right values.
> Rather check it against exiftool
> (
> exiftool -a -g1 -u image.tiff
> Windows Explorer also likes the "XP" values (eg. EXIF_TAG_XPCOMMENT,
> EXIF_TAG_XPAUTHOR), maybe try writing those as well?
> Damjan
Sorry for asking so many questions :( I hope it is okay.

Hmm. It does not seem like the XP values work. They do not show correctly.

Anyways, I tried using the code I sent you without special characters:
byte[] bytesComment = 

"KasperComment", set.byteOrder);
byte[] bytesAuthor = 
"KasperAuthor", set.byteOrder);
TiffOutputField commentField = new 
bytesComment.length, bytesComment);
TiffOutputField authorField = new 
TiffTagConstants.TIFF_TAG_ARTIST.dataTypes[0], bytesAuthor.length, 

Then the exif tools shows (and so do windows explorer):
---- IFD0 ----
Artist                          : KasperAuthor
---- ExifIFD ----
User Comment                    : KasperComment
---- JFIF ----
JFIF Version                    : 1.01

However, trying the same, but adding an å to KasperComment and 
KasperAuthor gives the following:
---- IFD0 ----
Artist                          : KasperAuthorå
---- ExifIFD ----
User Comment                    : 䭡獰敲䍯浭敮瓃
---- JFIF ----
JFIF Version                    : 1.01

It seems the UserComment has been destroyed. Now it is suddenly chinese 
Windows explorer shows the artist but not the usercomment.

Is this something to do with ExifDirectory vs RootDirectory?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message