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 2010-02-08 11:21:24.838846-08 by louiscar
Wildcard with -tagsfromfile
I'm not sure if this is possible but this situation arises fairly often so I'm keen to try to find a way to do this as a batch.

the following works well when the source is exactly 8 chars and the destination starts with those first 8 chars.

exiftool -tagsfromfile dir1/%%8f.jpg -all:all -ext jpg dir2

This works fine if:
source: dsc-1234.jpg
destination: dsc_1234_mono.jpg or dsc_1234_anything.jpg

Ideally what I'm trying to find is a way to give the source a wild card after the %8f because the originals are not necessarily 8 chars

so if:

source: dsc_1234_morechars.jpg or dsc_1234.jpg or dsc_12345.jpg
Destination : dsc_1234_anything.jpg

Is it possible to wildcard the source so that we ignore the first 8 characters but we match anything after that?
Direct Responses: 12344 | Write a response
Posted on 2010-02-08 11:45:59.786747-08 by exiftool in response to 12342
Re: Wildcard with -tagsfromfile
Don't you mean "match the first 8 characters but ignore everything else after that"?

I assume by source you mean the source for the -tagsFromFile option.

For this to work, you must be able to generate either the source or destination filename _exactly_. If the "anything" characters are different in each case, then this can't currently be done. If you can construct the source filename exactly then it is easy as you point out. If you can't do this but you can construct the destination filename exactly from the source filename, then it is a bit more complicated but you could use the -srcfile option to do this.

Otherwise you need to write your own script to make the associations you want.

Sorry, but exiftool doesn't have the ability to specify wildcards in the -tagsFromFile argument.

- Phil
Direct Responses: 12345 | Write a response
Posted on 2010-02-08 13:33:40.841831-08 by louiscar in response to 12344
Re: Wildcard with -tagsfromfile
[quote] I assume by source you mean the source for the -tagsFromFile option.

Quite right, got it the wrong way around.

Thanks for the answer, although I'm working on a perl script for some of my other gallery tasks it's not something I really want to deal with in that.
I think your renaming suggestion is probably far easier at this stage, I just wasn't sure if the option existed or not.
Direct Responses: Write a response