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 (Resolved) (JIRA)" <ji...@apache.org> on 2012/02/19 11:42:34 UTC

[jira] [Resolved] (SANSELAN-51) Tag reading/writing bugs and new ExifInterface class

     [ https://issues.apache.org/jira/browse/SANSELAN-51?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic resolved SANSELAN-51.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

All issues raised have been fixed, so resolving FIXED.

                
> 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
>             Fix For: 1.0
>
>         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