Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60AC510CCF for ; Mon, 29 Dec 2014 10:57:13 +0000 (UTC) Received: (qmail 53433 invoked by uid 500); 29 Dec 2014 10:57:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 53346 invoked by uid 500); 29 Dec 2014 10:57:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 53080 invoked by uid 99); 29 Dec 2014 10:57:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 10:57:13 +0000 Date: Mon, 29 Dec 2014 10:57:13 +0000 (UTC) From: "Benedikt Ritter (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IMAGING-132) Remove Exif, XMP and IPTC Metadata MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IMAGING-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benedikt Ritter updated IMAGING-132: ------------------------------------ Fix Version/s: Patch Needed > 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 > Labels: performance > Fix For: Patch Needed > > > 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 (v6.3.4#6332)