commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tonio Barmadosa (JIRA)" <>
Subject [jira] [Updated] (SANSELAN-51) Tag reading/writing bugs and new ExifInterface class
Date Mon, 27 Jun 2011 22:38:36 GMT


Tonio Barmadosa updated SANSELAN-51:

    Attachment:     (was: ExifInterface.patch)

> Tag reading/writing bugs and new ExifInterface class
> ----------------------------------------------------
>                 Key: SANSELAN-51
>                 URL:
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Android on Linux, 
> Windows 7
>            Reporter: Tonio Barmadosa
>              Labels: exif, gps
>         Attachments: IMAG05041.jpg, dsc00174.jpg
> Hi,
> Currently, I'm using Sanselan for Android. (
) because Android exif reading and writing is a bit buggy. I've implemented the ExifInterface
class in Sanselan based on this (
), 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 ( ). 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, which also shows example usage of ExifInterface. For example: 
> ExifInterface exifInterface = new ExifInterface(filePath);
> double oldAltitude = exifInterface.getAttributeDouble(GPSTagConstants.GPS_TAG_GPS_ALTITUDE,
> double newAltitude = 132.4;
> exifInterface.setAttribute(GPSTagConstants.GPS_TAG_GPS_ALTITUDE, newAltitude);
> exifInterface.saveAttributes();
> double newestAltitude = exifInterface.getAttributeDouble(GPSTagConstants.GPS_TAG_GPS_ALTITUDE,
> Cheers

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message