Phil,
I'm trying to figure out how to do the equivalent in Perl using Image::Exiftool to fix corrupted EXIF data.
This is the command line that fixes things up (and loses some data):
perl exiftool.pl -exif:all= -tagsfromfile @ -exif:all -unsafe -thumbnailimage -F test1.jpg
These are the warnings I'm dealing with that cause WriteInfo to fail:
Warning : Suspicious IFD0 offset for Make
Warning : Suspicious IFD0 offset for Model
Warning : Bad IFD1 directory
I've tried using SetNewValuesFromFile and FixBase => '' but that doesn't seem to help.
Is there a simple recipe for doing the command-line equivalent in Perl?
Thanks for the help.
This is the equivalent to the command you mention (except that it doesn't preserve a backup file):
#!/usr/bin/perl -w
use strict;
use Image::ExifTool;
my $file = shift or die "expecting file name\n";
my $et = new Image::ExifTool;
$et->Options(FixBase => '');
$et->SetNewValue('exif:all' => undef);
$et->SetNewValuesFromFile($file, 'exif:all', 'unsafe', 'thumbnailimage');
$et->WriteInfo($file);
- Phil
Awesome! Thanks for continuing to provide excellent support!