I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-08-07 16:27:05-07 by themonk
What Is The Most Efficent Way To Run ExifTool
Hi Phil

Just some feedback on how ExifTool works...

What is the most "efficent" way of invoking ExifTool to do the following

1. Remove all metdata from IPTC block and XMP block (-IPTC:All= -XMP:All=)
2. Set an IPTC value (-IPTC:By-line='Some Text')
3. Populate the XMP block with the IPTC values I have just set (-IPTC:By-line)

At the moment I am having to invoke exiftool several times or create an extra long command
to set both blocks to specific values... I like using "tagsFromFile" but this relies on the file
already existing.... (I presume it also makes life easier when modifying dates to
use "tagsFromFile")

Whilst I appreciate you can string certain groups of commands together it is not ideal and does not
always work....

For instance... To do 1+2 in a single operation does not seem possible....

ie... exiftool -IPTC:All= -IPTC:By-line="some text" testile.jpg

To do 1+2+3 in a single operation does not appear to work ...

In some cases I am having to write a file 3 times when I belive it would better if the file could be written once...

Your thoughts would be appreciated .... Thanks

Maybe using pipes is the answer, to at least save on the un-neccesary disk IO...?
Mark

Direct Responses: 2814 | Write a response
Posted on 2006-08-22 12:31:24-07 by exiftool in response to 2761
Re: What Is The Most Efficent Way To Run ExifTool
Hi Mark,

Yes, doing 1+2 is not currently possible because the delete currently takes precedence. But this is on my list of things to do, so eventually I may add the ability to do this.

Doing 2+3 together is possible, but unfortunately you can't take advantage of the -tagsfromfile syntax to do this. You must set the XMP tags explicitly as you are doing with the IPTC tags.

The pipes are an option, but they may cause temporary files to be created. You could also do this by writing a script yourself using the ExifTool API to rewrite an image in memory. Other than that, I don't have any good suggestions.

- Phil
Direct Responses: 3363 | Write a response
Posted on 2006-10-29 15:45:31-08 by chrisaga in response to 2814
Re: What Is The Most Efficent Way To Run ExifTool

Hello,

I have a similar issue.

I want to get all the IPTC tags plus creation date and time from a source file to a destination file with transfer from EXIF:CreateDate to IPTC:DateCreated and IPTC:TimeCreated. Im must get date and time from EXIF because my soft (bibblepro) doesn't set them in IPTC.
The best I have managed to do is :

exiftool -tagsfromfile src.tif -IPTC:All '-CreateDate>DateCreated' dst.tif exiftool -tagsfromfile src.tif -d "%H:%M:%S" '-CreateDate>TimeCreated' dst.tif

The date format "%H:%M:%S" is mandatory to set the time corectly (otherwise exiftool try to set the time from the year and month which is obviously wrong).

Maybe exiftool could detect the time in a "datetime" value and use it to set a time only tag, or be abble to do a one shot '-CreateDate>DateCreated TimeCreated'.

Regards
Chris

Direct Responses: 3365 | Write a response
Posted on 2006-10-30 00:27:01-08 by exiftool in response to 3363
Re: What Is The Most Efficent Way To Run ExifTool
I like your idea of being able to set the date-only or time-only tags from a date-time tag. But you can do what you want with the current ExifTool by adding a couple of user-defined Composite tags to the .ExifTool_config file:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::Composite' => { DateOnly => { Require => { 0 => 'CreateDate', }, ValueConv => '$val[0] =~ s/ .*//; $val[0]', }, TimeOnly => { Require => { 0 => 'CreateDate', }, ValueConv => '$val[0] =~ s/.* //; $val[0]', }, }, );

Then the command line is:

exiftool -tagsfromfile src.tif -IPTC:All '-DateOnly>DateCreated' '-TimeOnly>TimeCreated' dst.tif

Read the comments in the "ExifTool_config" file for more details about how the config file works.

Also, I should mention (although it doesn't relate to your problem) that the original problem from the first message in this thread can now easily be solved since ExifTool now has the ability to write back tags to a deleted group.

- Phil
Direct Responses: Write a response