commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Czajka <ptrcza...@gmail.com>
Subject [imaging] Special characters in edited exif tag
Date Mon, 14 Jan 2013 07:55:13 GMT
Hi,
 I 'm using  Imaging 1.0 snapshot version and when I add/update tag with
special characters string is not reads correctly

e.g.
 --------- input-------------      ------------------output ---------------
ARTIST:
     aaaeeeccc                         aaaeeeccc

ok, but

--------- input-------------      ------------------output ---------------
ARTIST:
     aąaeęecćc                         aÄ…acćceÄ™e

USER COMMENT:
     aąaeęecćc                        aąacćceęę
(correct)

IMAGE DESCROPTION:
     aąaeęecćc                       aÄ…acćceÄ™e

COPYRIGHT:
     aąaeęecćc                      aÄ…acćceÄ™e


in user comment string is reads correctly but in other tags isn't.

code:
                 //.....
                TiffOutputDirectory exifIFD0Directory =
outputTiffSet.getOrCreateRootDirectory();
                TiffOutputDirectory exifSubIFDDirectory =
outputTiffSet.getOrCreateExifDirectory();

            switch(type)
            {
                case AUTHOR:

if(outputTiffSet.findField(TiffTagConstants.TIFF_TAG_ARTIST) != null)
                    {

exifIFD0Directory.removeField(TiffTagConstants.TIFF_TAG_ARTIST);

exifIFD0Directory.add(TiffTagConstants.TIFF_TAG_ARTIST, text);
                    }
                    else
                    {

exifIFD0Directory.add(TiffTagConstants.TIFF_TAG_ARTIST, text);
                    }
                    break;

                case COMMENT:

if(outputTiffSet.findField(ExifTagConstants.EXIF_TAG_USER_COMMENT) != null)
                    {

exifSubIFDDirectory.removeField(ExifTagConstants.EXIF_TAG_USER_COMMENT);

exifSubIFDDirectory.add(ExifTagConstants.EXIF_TAG_USER_COMMENT, text);

                    }
                    else
                    {

exifSubIFDDirectory.add(ExifTagConstants.EXIF_TAG_USER_COMMENT, text);
                    }
                break;

                case IMAGE_DESRC:

if(outputTiffSet.findField(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION) !=
null)
                    {

exifIFD0Directory.removeField(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION);

exifIFD0Directory.add(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION,
text);
                    }
                    else
                    {

exifIFD0Directory.add(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION, text);
                    }
                    break;

              case COPYRIGHT:

if(outputTiffSet.findField(TiffConstants.TIFF_TAG_COPYRIGHT) != null)
                    {

exifIFD0Directory.removeField(TiffConstants.TIFF_TAG_COPYRIGHT);

exifIFD0Directory.add(TiffConstants.TIFF_TAG_COPYRIGHT, text);
                    }
                    else
                    {

exifIFD0Directory.add(TiffConstants.TIFF_TAG_COPYRIGHT, text);
                    }
                    break;

            }
           //....

please help

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