Discussion:
Lossless EXIF strip from JPEG?
R***@aol.com
2011-05-08 12:14:15 UTC
Permalink
I'd like the ability to remove the EXIF information (including thumbnail,
metadata, camera info... everything!) from JPEG files, but I want to avoid
recompression.

I'm looking for a Unix/Linux solution that can be interfaced via Perl
(such as ImageMagick can be used via PerlMagick). I am familiar with
ImageMagick "-strip" and the result seems to need be recompressed.

Suggestions welcome!

Thanks,

Rob
Ludovic Levesque
2011-05-08 19:32:08 UTC
Permalink
Hi,

exiftool (written in Perl) does this very easily:
exiftool -exif:all= filename.jpg

Ludo
I'd like the ability to remove the EXIF information (including  thumbnail,
metadata, camera info... everything!) from JPEG files, but  I want to avoid
recompression.
I'm looking for a Unix/Linux solution  that can be interfaced via Perl
(such as ImageMagick can be used via  PerlMagick). I am familiar with
ImageMagick "-strip" and the result seems  to need be recompressed.
Suggestions welcome!
Thanks,
Rob
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-users
R***@aol.com
2011-05-08 22:00:27 UTC
Permalink
Thank you Ludo!

With the Image::ExifTool Perl module installed, I found the following to
be equivalent to the command line method. For execution from a script
without a system call. In case anyone is interested in the future:

use Image::ExifTool;
$exifTool = new Image::ExifTool;
$exifTool->SetNewValue('*'); # delete all...
$exifTool->WriteInfo('original_image.jpg','modified_image.jpg');
$errorMessage = $exifTool->GetValue('Error');
print $errorMessage; # (if has value an error occurred)

Took some figuring because I was thinking I'd need to load the image before
changing it. Turns out I needed to assign the setting first using
SetNewValue then load and save simultaneously using WriteInfo.

~Rob


In a message dated 5/8/2011 2:34:23 P.M. Central Daylight Time,
***@gmail.com writes:
Hi,

exiftool (written in Perl) does this very easily:
exiftool -exif:all= filename.jpg

Ludo
I'd like the ability to remove the EXIF information (including
thumbnail,
metadata, camera info... everything!) from JPEG files, but I want to
avoid
recompression.
I'm looking for a Unix/Linux solution that can be interfaced via Perl
(such as ImageMagick can be used via PerlMagick). I am familiar with
ImageMagick "-strip" and the result seems to need be recompressed.
Suggestions welcome!
Thanks,
Rob
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-users
Anthony Thyssen
2011-05-09 01:51:07 UTC
Permalink
On Sun, 8 May 2011 18:00:27 EDT
magick-users-***@imagemagick.org wrote:
|
| With the Image::ExifTool Perl module installed, I found the following to
| be equivalent to the command line method. For execution from a script
| without a system call. In case anyone is interested in the future:
|
| use Image::ExifTool;
| $exifTool = new Image::ExifTool;
| $exifTool->SetNewValue('*'); # delete all...
| $exifTool->WriteInfo('original_image.jpg','modified_image.jpg');
| $errorMessage = $exifTool->GetValue('Error');
| print $errorMessage; # (if has value an error occurred)
|
| Took some figuring because I was thinking I'd need to load the image before
| changing it. Turns out I needed to assign the setting first using
| SetNewValue then load and save simultaneously using WriteInfo.
|
| ~Rob

If you just want a command line tool look at jhead
http://www.sentex.net/~mwandel/jhead/

It is a simple package install for most Linux systems, probably Macs too.


Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
How many hardware guys does it take to change a light bulb?
"Well the diagnostics say it's fine buddy, so it's a software problem."
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/
Roger Howard
2011-05-09 03:38:44 UTC
Permalink
Post by Anthony Thyssen
On Sun, 8 May 2011 18:00:27 EDT
|
| With the Image::ExifTool Perl module installed, I found the following to
| be equivalent to the command line method. For execution from a script
|
| use Image::ExifTool;
| $exifTool = new Image::ExifTool;
| $exifTool->SetNewValue('*'); # delete all...
| $exifTool->WriteInfo('original_image.jpg','modified_image.jpg');
| $errorMessage = $exifTool->GetValue('Error');
| print $errorMessage; # (if has value an error occurred)
|
| Took some figuring because I was thinking I'd need to load the image before
| changing it. Turns out I needed to assign the setting first using
| SetNewValue then load and save simultaneously using WriteInfo.
|
| ~Rob
If you just want a command line tool look at jhead
http://www.sentex.net/~mwandel/jhead/
It is a simple package install for most Linux systems, probably Macs too.
Exiftool runs as a command line app too - the command for stripping all metadata from an image file is:

exiftool -overwrite_original -all= "/path/to/image.jpg"

-Roger
Wolfgang Hugemann
2011-05-09 06:54:32 UTC
Permalink
Post by Anthony Thyssen
If you just want a command line tool look at jhead
http://www.sentex.net/~mwandel/jhead/
It is a simple package install for most Linux systems, probably Macs too.
I use both, Exiftool and jhead, under Windows quite a lot and found that
jhead does its job much quicker than Exiftool. So if you have the option
to choose, you'd better go for jhead.

There are, howerver, lots of more sophisticated manipulations that can
only be performed by Exiftool. But stripping of all EXIF data is easy
and an be done by jhead.

Wolfgang Hugemann

Continue reading on narkive:
Search results for 'Lossless EXIF strip from JPEG?' (Questions and Answers)
5
replies
How do I upload a gimp file as an image online?
started 2013-03-06 23:48:58 UTC
software
Loading...