[jira] [Commented] (SANSELAN-7) How to extract EXIF_TAG_XPTITLE as string.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SANSELAN-7) How to extract EXIF_TAG_XPTITLE as string.

Gilles (Jira)

    [ https://issues.apache.org/jira/browse/SANSELAN-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211284#comment-13211284 ]

Damjan Jovanovic commented on SANSELAN-7:
-----------------------------------------

My tests show the field is always little-endian UTF-16 with no byte-order mark, whether the TIFF file/EXIF metadata is little-endian or big-endian. This is with both Windows XP SP 3 and Vista SP1.

Using type=1 (byte) to store strings is really bad practice. If they wanted to use Windows's internal string representation, Microsoft should have used at least used type=7 (undefined).

With the old Sanselan API, you can use:
{code}
String xpTitle = new String(tiffField.getByteArrayValue(), "UTF-16LE");
{code}

From version 1.0 you should also be able to do:
{code}
String xpTitle = tiffImageMetadata.getFieldValue(ExifTagConstants.EXIF_TAG_XPTITLE);
{code}

               

> How to extract EXIF_TAG_XPTITLE as string.
> ------------------------------------------
>
>                 Key: SANSELAN-7
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-7
>             Project: Commons Sanselan
>          Issue Type: Question
>            Reporter: Charles Matthew Chen
>         Attachments: 2008-07-27 - Photo 216 - WE √† l'√©tang de Blodelsheim.jpg
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira