You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bruno P. Kinoshita (Jira)" <ji...@apache.org> on 2020/04/13 02:52:00 UTC

[jira] [Resolved] (IMAGING-132) Remove Exif, XMP and IPTC Metadata

     [ https://issues.apache.org/jira/browse/IMAGING-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruno P. Kinoshita resolved IMAGING-132.
----------------------------------------
    Fix Version/s:     (was: Patch Needed)
       Resolution: Not A Problem

> 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-alpha1
>         Environment: Windows
>            Reporter: Jacinto Verdaguer
>            Assignee: Bruno P. Kinoshita
>            Priority: Major
>              Labels: performance
>
> I need to delete all the metadata (Exif, IPTC and XMP) of many JPEG images.
> Is there a single command to do this?
> {code:java}
> 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);
>         }
>     }
> {code}
> This form seems too slow, involves reading and writing the file 3 times.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)