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 20:37:59 GMT
On 07-03-2012 19:41, Damjan Jovanovic wrote:
> On Wed, Mar 7, 2012 at 8:07 PM, Kasper Føns<>  wrote:
>> 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
>> cleaner.
>> 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?
>> /Kasper
> No, sorry, Android isn't supported at the moment. There is a fork
> ( which supposedly lets you
> do EXIF on Android, but I've never tried it.
> Damjan
Hi again again.

So, the android port is using 0.97 unfortunately, so I can't make use of 
your nice API.
Is it possible that you could show me with an example, how I would write 
the tag "UserComment" using 0.97? Do you have some samples I can look at?
Also, the website seems to contain a lot of dead links.


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

View raw message