incubator-sanselan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Nicolas Charlier" <jncha...@club-internet.fr>
Subject How to get the value of EXIF_TAG_XPTITLE
Date Tue, 29 Jul 2008 20:54:34 GMT
Hello,

 

I'm using the sanselan library.

I would like to get back the EXIF_TAG_XPTITLE tag in a picture.

In the following example, I set the XP title field to
"abcdefghijklmnopqrstuvwxyz" in my test picture.

 

Roughly, my code is :

 

    private JpegImageMetadata _metaData;

 

        TiffField xField;

 

            xField =
_metaData.findEXIFValue(TiffConstants.EXIF_TAG_XPTITLE);

 

            _logger.debug("getFieldTypeName = " +
xField.getFieldTypeName());

            _logger.debug("getValueDescription = " +
xField.getValueDescription());

            try {_logger.debug("getBytesLength = " +
xField.getBytesLength());} catch (ImageReadException x)
{_logger.debug("getValue : ImageReadException");}

 

I get back :

 

 

08-07-29 22:35:18 (JpegNodes.JpegFile,getTitleFromExif) DEBUG :
getFieldTypeName = Byte

08-07-29 22:35:18 (JpegNodes.JpegFile,getTitleFromExif) DEBUG :
getValueDescription = 97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, 0,
104, 0, 105, 0, 106, 0, 107, 0, 108, 0, 109, 0, 110, 0, 111, 0, 112, 0, 113,
0, 114, 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, 0, 120, 0, 121, 0, 122...
(54)

08-07-29 22:35:23 (JpegNodes.JpegFile,getTitleFromExif) DEBUG :
getBytesLength = 54

 

So, it seems I have a list of bytes, representing the (extended ?) ASCII
codes separated with 0.

The fact is that the available methods allows me to get this bytes array
through an Object (using getValue) or a String (using getValueDescription).

All I want is a string corresponding to the initial
"abcdefghijklmnopqrstuvwxyz" string.

 

Should I code some hand-made unefficiend procedure to turn the returned
String "0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, 0, 104, 0, 105, 0,
106, 0, 107, 0." to the correct string "abcedfghijklmnopqrstuvwxyz" ?

Can someone help ?

 

 

Regards,

 

JNC


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message