Hello, world!

My project involves resizing images.  I need to keep the EXIF metadata
though.  I wrote a bit of code* that copies EXIF data from the original
image to the resized one, but it instead copies the entire image, not
just the metadata.

So I need either

1.  A way to copy _only_ the metadata between images, or
2.  A way to read the whole image with Sanselan, manipulate the image
data, and then write the whole thing, metadata and all, to a new file.

I haven't been able to find a solution reading any documentation I could
find, tutorials, or the sample code.  Thanks!


* Code here:
try {
        IImageMetadata metadata = Sanselan.getMetadata(original);
        JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
        if (jpegMetadata != null) {
                TiffImageMetadata exif = jpegMetadata.getExif();
                if (exif != null) {
                        TiffOutputSet outputSet = exif.getOutputSet();
                        OutputStream outputStream = new BufferedOutputStream(new
FileOutputStream(copy));
                        new ExifRewriter().updateExifMetadataLossless(original, 
outputStream,
outputSet);
                        outputStream.close();
// ...


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to