commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Føns <>
Subject Re: [sanselan] Writing EXIF data to JPEG
Date Wed, 07 Mar 2012 18:07:14 GMT
On 07-03-2012 06:37, Damjan Jovanovic wrote:
> On Wed, Mar 7, 2012 at 12:46 AM, Kasper Føns<>  wrote:
>> Hi Sanselan.
>> I have a hard time finding out how to use Sanselan.
>> Suppose I have some JPEG picture which I want to add some attributes to.
>> If for example I want to add some user comment or date I try this:
>> TiffOutputSet outputSet = new TiffOutputSet();
>> TiffOutputField dateTaken =
>> TiffOutputField.create(TiffConstants.EXIF_TAG_CREATE_DATE,
>> outputSet.byteOrder, "2003:03:29 17:47:50");
>> TiffOutputField comment =
>> TiffOutputField.create(TiffConstants.EXIF_TAG_IMAGE_DESCRIPTION,
>> outputSet.byteOrder, "This is a test!");
>> However, both of these fails on "unexpected data type".
>> If I am not supposed to give a String, then what I am supposed to supply?
>> I hope you can help with these, probably noobish questions.
>> /Kasper
> That TiffOutputField.create() was a horribly broken API that I've
> eliminated in the latest SVN, and replaced with a new, beautiful, type
> safe, code completable, byte order independent
> TiffOutputDirectory.add() API.
> I recommend you use the latest SVN, or wait for the 1.0 release in a
> few weeks. If you really must use version 0.97, I think the only way
> to get strings to work is to convert the string to bytes with
> getBytes(), null-terminate those yourself, then pass them to the
> low-level constructor "new TiffOutputField(...)".
> Damjan

Hi again Damjan.

Thanks for the response. I have had a look at the new API, and it looks 

I want to run this on Android, and I can see that there is a heavy 
dependency on java.awt, which unfortunately is not in Android.
Do you have some hints as what to do?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message