[
https://issues.apache.org/jira/browse/SANSELAN-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211305#comment-13211305
]
Damjan Jovanovic commented on SANSELAN-51:
------------------------------------------
1a. Fixed by commit 1212318.
1b. Not a problem in current HEAD. Sanselan only writes ASCII or UTF-8
depending on what it detects the string is, either way it can be read again.
However exiftool can't read our GPS text because we write it in UTF-8, we
should be using UCS-2 in whatever byte order the TIFF file uses. This was fixed
in commit 1290986.
2. Fixed by commit 1211843.
3. Short was fixed in commit 1245871.
A new high-level type-safe EXIF interface was added in commit 1245871 and fixed
up in the subsequent commit.
> Tag reading/writing bugs and new ExifInterface class
> ----------------------------------------------------
>
> Key: SANSELAN-51
> URL: https://issues.apache.org/jira/browse/SANSELAN-51
> Project: Commons Sanselan
> Issue Type: Bug
> Components: Format: TIFF
> Affects Versions: 0.94-incubator
> Environment: Android on Linux,
> Windows 7
> Reporter: Tonio Barmadosa
> Labels: exif, gps
> Attachments: ExifInterface.patch, IMAG05041.jpg, dsc00174.jpg
>
>
> Hi,
> Currently, I'm using Sanselan for Android. (
> http://code.google.com/p/sanselanandroid/ ) because Android exif reading and
> writing is a bit buggy. I've implemented the ExifInterface class in Sanselan
> based on this (
> http://developer.android.com/reference/android/media/ExifInterface.html ),
> and tested it with several jpeg images and various exif and gps tags. It
> seems to work on Android, but when I tried to integrate it with the main
> Sanselan project, I got some exceptions.
>
> 1. String type writing and reading
> * In TiffOutputField.create(), when a String value is passed, sometimes the
> ASCII field type is not identified correctly, whereas in the Android project,
> it is. I've merged the two projects and now ASCII fields are always
> identified.
> 1.a Exif string reading and writing
> * For instance, the IMAGE_DESCRIPTION field is written correctly in the
> Android project, but in the main Sanselan it writes empty spaces.
> 1.b GPS string reading and writing
> * For GPS tags, it reads them fine first, then writes them fine. But on
> second try, it cannot read them properly. With a program called ExifTool,
> however, the tags are parsable from the file
> 2. Tag Constant Values
> * I've corrected some of the TagInfo constants in ExifTagConstants and
> GpsTagConstants based on this reference (
> http://www.awaresystems.be/imaging/tiff/tifftags.html ). For example,
> GPSImgDirection, GPSAltitude, GPSAltitudeRef ... etc, length was -1 in
> Sanselan, but in the reference, it is 1.
> 3. ShortFieldType
> * In addition, when a short is passed to a ShortFieldType, it throws an
> exception, saying it expects an integer? I'm not really sure what that means.
> Anyways, I'm not very familiar with the EXIF specification, so I did not
> change the way values are written on the byte level. Nevertheless, I've
> tested ExifInterface with some other common tags and it does work with those.
> For the problematic cases, you can find the tests in ExifInterfaceTest.java,
> which also shows example usage of ExifInterface. For example:
> ExifInterface exifInterface = new ExifInterface(filePath);
> double oldAltitude =
> exifInterface.getAttributeDouble(GPSTagConstants.GPS_TAG_GPS_ALTITUDE, 0);
> double newAltitude = 132.4;
> exifInterface.setAttribute(GPSTagConstants.GPS_TAG_GPS_ALTITUDE, newAltitude);
> exifInterface.saveAttributes();
> double newestAltitude =
> exifInterface.getAttributeDouble(GPSTagConstants.GPS_TAG_GPS_ALTITUDE, 0);
> Cheers
--
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