commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Tomko <martin.to...@geo.uzh.ch>
Subject SANSELAN - parameters for writing exif metadata using TiffOutputField.create()
Date Wed, 15 Jul 2009 11:53:56 GMT
Dear All,
I have been using Sanselan for some time with success to read metadata, 
and to write in Lat/lon using the provided convenience method. I am now 
trying to alter some other fields, and am not able to decode the 
expected parameters in order to successfully write the values in.

example:

float azimut = ...

TiffOutputField dirfield = 
outputSet.findField(GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION);  
            if (dirfield != null) {
                
outputSet.removeField(GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION);
                 
outputSet.removeField(GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF);
            }

 try {                  
                TiffOutputField    azimutField = 
TiffOutputField.create(GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION,outputSet.byteOrder, 
azimut);
                TiffOutputField azimutFieldRef = 
TiffOutputField.create(GPSTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF,outputSet.byteOrder,

"M");

                exifDirectory = outputSet.getOrCreateExifDirectory();
                exifDirectory.add(azimutField);
                exifDirectory.add(azimutFieldRef);
           
            } catch (ImageWriteException e) {
                e.printStackTrace();
            }

Results in the following Exception:
org.cmc.sanselan.ImageWriteException: Tag does not expect a single value.
    at 
org.cmc.sanselan.formats.tiff.write.TiffOutputField.create(TiffOutputField.java:73)

What are the correct values to be used? Where can I find the 
documentation for the parameter values, especially the byte order and 
the allowed value types for the variables?
Thanks
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message