Hi Charles. Isn't the xmp metadata stored in app13? I thought that
xmp and the other photoshop format were two ways to represent the same
thing (iptc metadata) stored in app13. Maybe I don't understand...
Sent from my iPhone
On Aug 6, 2008, at 4:29 PM, "Charles Matthew Chen" <[EMAIL PROTECTED]
> wrote:
Hi Christopher,
This is an interesting question.
Sanselan cannot read or write image data from JPEG files, so it
can't be used to resize the images. However, it can be used to read
and write metadata from existing JPEGs. It can currently write EXIF
metadata, including copying EXIF data from one jpg to another (ie. the
resized image file). It can also do this with XMP metadata. The
ability to do something similar with IPTC metadata is under active
development and should be ready soon.
For an example of the EXIF update feature, see the
changeExifMetadata() example in this file, which should be easily
adapted to your needs:
https://svn.apache.org/repos/asf/incubator/sanselan/trunk/src/examples/java/org/apache/sanselan/sampleUsage/WriteExifMetadataExample.java
Charles
On Tue, Aug 5, 2008 at 11:43 PM, Christopher Blunck
<[EMAIL PROTECTED]> wrote:
Hello,
I have JFIF files that are rich in IPTC and EXIF metadata. I
currently use
JAI to resize those images to smaller sizes suitable for publishing
on the
web. Unfortunately when I perform that resizing in JAI I lose all
of my
APP0-APP13 metadata.
Can Sanselan help me?
Can I resize images in Sanselan and preserve the original IPTC/EXIF
metadata?
Alternatively can I read the IPTC/EXIF metadata contained in the APP
sections from my original files and merge it into the images that JAI
produces?
I'm really stuck and I've been working on some prototype python
code to
merge in JPEG sections at the byte[] level but it's not working.
I've
reviewed a lot of material online and am familiar with some of the
format
rules for JPEG/JFIF files. I've even written code that can harvest
the 0xFF
0xED (APP13 section) metadata and drop it into another file that
does not
contain 0xFF 0xED. Unfortunately I just did it at the top of the
file
(immediately after 0xFF 0xD8) and I believe that 0xFF 0xE0 is always
supposed to immediately follow the SOS. I parsed out the length of
the 0xFF
0xE0 section and tried inserting my APP13 section AFTER the 0xFF 0xE0
section but that didn't work.
Any pointers or directions would really be appreciated.
-c