ImageRemoveEXIFMetadata

I have a project working with jpeg files. I need to remove the EXIF data
after people upload their images. I noticed CFML has
a ImageGetExifMetaData() function but not a ImageRemoveEXIFMetadata().
Does anyone have a good method of removing the EXIF data from a jpeg image?

Andrew Penhorwood

After ImageCopy() you should have a new image object with only basic JPEG
info (width, height…) and no camera EXIF.
ImageResize keeps everything, check EXIF after step 3 in your scenario.

It works fine in my experience.
Attach a sample JPEG file, I will test against it.

Do you work with JPEG or something else? I use stable Lucee 4.5.1.000On Friday, May 15, 2015 at 1:29:57 PM UTC+3, Andrew Penhorwood wrote:

I tried this and it does not work.

I am currently doing this:

  1. imageNew( )
  2. imageResize( )
  3. imageCopy( )
  4. imageWrite( )

When I use ImageGetExifMetaData() on the resized file all of the EXIF meta
data is still there.

There is a remove method in this java
http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html
class

The problem is I can’t figure out had to create a java instance / object
to use those methods.

Andrew Penhorwood

On Friday, May 15, 2015 at 4:33:55 AM UTC-4, Alexei Beloglazov wrote:

Hi Andrew!
Try ImageCopy() then ImageWrite()

On Friday, May 15, 2015 at 6:12:35 AM UTC+3, Andrew Penhorwood wrote:

I have a project working with jpeg files. I need to remove the EXIF
data after people upload their images. I noticed CFML has
a ImageGetExifMetaData() function but not a ImageRemoveEXIFMetadata().
Does anyone have a good method of removing the EXIF data from a jpeg image?

Andrew Penhorwood

You can get lossless image optimisers that remove metadata (and
do fancy maths stuff to rearrange bytes and get smaller file sizes
without losing image quality, which may or not be useful).

Alternatively, you could try exiv2.org - I use it for renaming
photos based on their metadata, but it has a remove option too.

Hi Andrew!
Try ImageCopy() then ImageWrite()On Friday, May 15, 2015 at 6:12:35 AM UTC+3, Andrew Penhorwood wrote:

I have a project working with jpeg files. I need to remove the EXIF data
after people upload their images. I noticed CFML has
a ImageGetExifMetaData() function but not a ImageRemoveEXIFMetadata().
Does anyone have a good method of removing the EXIF data from a jpeg image?

Andrew Penhorwood

I tried this and it does not work.

I am currently doing this:

  1. imageNew( )
  2. imageResize( )
  3. imageCopy( )
  4. imageWrite( )

When I use ImageGetExifMetaData() on the resized file all of the EXIF meta
data is still there.

There is a remove method in this
java http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html
class

The problem is I can’t figure out had to create a java instance / object to
use those methods.

Andrew PenhorwoodOn Friday, May 15, 2015 at 4:33:55 AM UTC-4, Alexei Beloglazov wrote:

Hi Andrew!
Try ImageCopy() then ImageWrite()

On Friday, May 15, 2015 at 6:12:35 AM UTC+3, Andrew Penhorwood wrote:

I have a project working with jpeg files. I need to remove the EXIF data
after people upload their images. I noticed CFML has
a ImageGetExifMetaData() function but not a ImageRemoveEXIFMetadata().
Does anyone have a good method of removing the EXIF data from a jpeg image?

Andrew Penhorwood

In my testing the imageNew() → imageCopy → imageWrite() adventure does
not remove EXIF data. I can view the EXIF in both versions of the file.
The copied one even has one more data point then the original.

Andrew PenhorwoodOn Friday, May 15, 2015 at 7:53:01 AM UTC-4, Alexei Beloglazov wrote:

After ImageCopy() you should have a new image object with only basic
JPEG info (width, height…) and no camera EXIF.
ImageResize keeps everything, check EXIF after step 3 in your scenario.

It works fine in my experience.
Attach a sample JPEG file, I will test against it.

Do you work with JPEG or something else? I use stable Lucee 4.5.1.000

On Friday, May 15, 2015 at 1:29:57 PM UTC+3, Andrew Penhorwood wrote:

I tried this and it does not work.

I am currently doing this:

  1. imageNew( )
  2. imageResize( )
  3. imageCopy( )
  4. imageWrite( )

When I use ImageGetExifMetaData() on the resized file all of the EXIF
meta data is still there.

There is a remove method in this java
http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html
class

The problem is I can’t figure out had to create a java instance / object
to use those methods.

Andrew Penhorwood

On Friday, May 15, 2015 at 4:33:55 AM UTC-4, Alexei Beloglazov wrote:

Hi Andrew!
Try ImageCopy() then ImageWrite()

On Friday, May 15, 2015 at 6:12:35 AM UTC+3, Andrew Penhorwood wrote:

I have a project working with jpeg files. I need to remove the EXIF
data after people upload their images. I noticed CFML has
a ImageGetExifMetaData() function but not a ImageRemoveEXIFMetadata().
Does anyone have a good method of removing the EXIF data from a jpeg image?

Andrew Penhorwood

please see this removeExifMetadata().

http://commons.apache.org/proper/commons-imaging/index.html

and see also