You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org> on 2012/02/19 09:34:34 UTC

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

    [ 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