Equivalent of overwrite_original_in_place and -P argument within Image::ExifTool

Started by philW, August 20, 2012, 02:22:57 PM

Previous topic - Next topic

philW

First, a thousand thanks to Phil Harvey for providing and maintaining such an absolute vital EXIF tool!

Next, a question regarding the use of the Perl Module Image::ExifTool with ExifTool.

I wrote a Perl script to fix various EXIF inconsistencies introduced by the notorious EXIF stone age handlers, namely Adobe Photoshop and Apple Aperture, when importing Sony Alpha/NEX RAW's and saving to TIFF. These cover mainly fixes for Lens ID designations and teleconverter usage identification (for which there is actually a Sony maker note tag but is ignored/stripped). One script reads the specific TIFF EXIF's and outputs the corrected fields. The other script then writes the corrected/validated EXIF information to the relevant files. The teleconverter info is added to the "Keywords" field.

Question: What is the equivalent of overwrite_original_in_place and the -P argument when using Image::ExifTool? I researched all available resources to no avail. "overwrite_original" is clear - you just omit the destination file with $exifTool->WriteInfo.

Thanks!



philW

To clarify:

My goal is to preserve the filesystem creation and modification dates of the modified TIFF files on a Mac OS X platform.

I'm aware that one could also post-correct the file dates based on EXIF creation dates via terminal with:
exiftool -overwrite_original "-filemodifydate<datetimeoriginal" "-modifydate<datetimeoriginal" "-metadatadate<datetimeoriginal" "-historywhen<datetimeoriginal" FILE

And if the filesystem modification date is set earlier than the creation date, Mac OS X will change the creation date as well.

But how would you approach this via the Perl module Image::ExifTool?

philW

In another note:

It seems to me that some lenses are missing in the Minolta ID Lens hash:

Sony 16mm F2.8 Fisheye (SAL16F28)
Sony 24-105mm F3.5-4.5 (SAL24105)
Sony 50mm F2.8 Macro (SAL50M28)
Sony 70-200mm F2.8 G (D) SSM (SAL70200G)
Sony 100mm F2.8 Macro (SAL100M28)
Sony 135mm F2.8 [T4.5] STF (SAL135F28)
Minolta AF 300mm F2.8 G SSM
Sony 300mm F2.8 G SSM (SAL300F28G)
Sony 500mm F8 Reflex (SAL500F80)
Sony DT 18-70mm F3.5-5.6 (SAL1870)
Sony DT 18-200mm F3.5-6.3 (SAL18200)
Sigma DG 28-300 F3.5-6.3 Makro

Phil Harvey

The equivalent to -overwrite_original is to use the single-argument form of WriteInfo().

There is no equivalent API option for -P, but it is easy to do in your script:

my $accTime = $^T - (-A $file) * (24 * 3600);
my $modTime = $^T - (-M $file) * (24 * 3600);
$exifTool->WriteInfo($file);
utime($accTime, $modTime, $file);


About the missing lenses.  The first 2 are in the list as Minolta/Sony entries since the Minolta lens has the same ID.  I didn't check the rest, but I'm very happy to add any new ID's that you discover.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

philW

Thanks, good work-around!

As to the lenses, in that case really missing are the following:

Minolta AF 70-210mm F4.5-5.6 [New]
Sigma DG 28-300mm F3.5-6.3 Makro
Sony DT 18-200mm F3.5-6.3 (SAL18200)
Sony E 16mm F2.8
Sony E 18-200mm F3.5-6.3 OSS
Sony E 18-55mm F3.5-5.6 OSS
Sony E 24mm F1.8 ZA
Sony E 30mm F2.8
Sony E 50mm F1.8

Phil Harvey

Thanks for the lens list.  I'll add these to the lenses I'm looking for.  Please let me know if you find any of them.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).