You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sanselan-dev@incubator.apache.org by David Underhill <do...@gmail.com> on 2008/12/17 16:59:05 UTC

suggestion: add / extend the metadata writer example

Just a thought: it might be helpful to provide an example of how to write
string-based EXIF fields.  I had to do some googling to come across this
article which showed me how (http://www.screaming-penguin.com/node/7485).
It was helpful to me since I was trying to write the UserComment field.
However, I ran into a little issue when doing it -- the definition of the
UserComment field in the EXIF standard says that the first eight bytes is a
"code" which tells a reader how to interpret the rest of the UserComment
field. It is a simple extension to write the code to add this header ...
here it is:

String userCommentHeaderForASCII = "ASCII\0\0\0";
String userCommentData = userCommentHeaderForASCII + "some string value";
TiffOutputField uc = new
TiffOutputField(TiffConstants.EXIF_TAG_USER_COMMENT,
TiffConstants.FIELD_TYPE_ASCII,
userCommentData.length(),
userCommentData.getBytes());
People here know this, but it might be nice to include it in a little
example for newcomers to the API like me :).

Thanks,

~ David

Re: suggestion: add / extend the metadata writer example

Posted by Charles Matthew Chen <ch...@gmail.com>.
Hi David,

   That's a great point.  The project would definitely benefit from
having more (and better) example code - as well as other
documentation.  If you would like to contribute any other examples,
that would be helpful.

Thanks,
   Charles


On Wed, Dec 17, 2008 at 11:59 AM, David Underhill <do...@gmail.com> wrote:
> Just a thought: it might be helpful to provide an example of how to write
> string-based EXIF fields.  I had to do some googling to come across this
> article which showed me how (http://www.screaming-penguin.com/node/7485).
> It was helpful to me since I was trying to write the UserComment field.
> However, I ran into a little issue when doing it -- the definition of the
> UserComment field in the EXIF standard says that the first eight bytes is a
> "code" which tells a reader how to interpret the rest of the UserComment
> field. It is a simple extension to write the code to add this header ...
> here it is:
>
> String userCommentHeaderForASCII = "ASCII\0\0\0";
> String userCommentData = userCommentHeaderForASCII + "some string value";
> TiffOutputField uc = new
> TiffOutputField(TiffConstants.EXIF_TAG_USER_COMMENT,
> TiffConstants.FIELD_TYPE_ASCII,
> userCommentData.length(),
> userCommentData.getBytes());
> People here know this, but it might be nice to include it in a little
> example for newcomers to the API like me :).
>
> Thanks,
>
> ~ David
>