commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacinto Verdaguer (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IMAGING-132) Remove Exif, XMP and IPTC Metadata
Date Tue, 27 May 2014 10:54:01 GMT
Jacinto Verdaguer created IMAGING-132:
-----------------------------------------

             Summary: Remove Exif, XMP and IPTC Metadata
                 Key: IMAGING-132
                 URL: https://issues.apache.org/jira/browse/IMAGING-132
             Project: Commons Imaging
          Issue Type: Improvement
          Components: Format: JPEG
    Affects Versions: 1.0
         Environment: Windows
            Reporter: Jacinto Verdaguer


I need to delete all the metadata (Exif, IPTC and XMP) of many JPEG images.

Is there a single command to do this?

public static void removeExifMetadata(final File jpegImageFile, final File dst, boolean exif,
boolean xmp, boolean iptc) throws IOException, ImageReadException, ImageWriteException {
        OutputStream os = null;
        boolean canThrow = false;
        try {
            os = new FileOutputStream(dst);
            os = new BufferedOutputStream(os);

            if(exif)
                new ExifRewriter().removeExifMetadata(jpegImageFile, os);
            else if(iptc)
                new JpegIptcRewriter().removeIPTC(jpegImageFile, os);
            else if (xmp)
                new JpegXmpRewriter().removeXmpXml(jpegImageFile, os);

            canThrow = true;
        } finally {
            IoUtils.closeQuietly(canThrow, os);
        }
    }

This form seems too slow, involves reading and writing the file 3 times.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message