Posted on 2005-10-25 11:47:06-07 by exiftool in response to 1229
Re: SetNewValuesFromFile using XMP Template

Thanks for your feedback. I guess this is a bit confusing because the example for SetNewValues() is:

$info = $exifTool->SetNewValuesFromFile($srcFile, @tags);

You are correct, the second argument is a list. But in Perl, this is the same as

$info = $exifTool->SetNewValuesFromFile($srcFile, $tag1, $tag1, ... );

What you did was pass a reference to an anonymous list, which is distinctly different than passing the list itself. But I'm sure you see this now.

And I understand your comment about WriteInfo(). You're right, it doesn't work on a file in place. This is a bit inconvenient I'll admit, but it doesn't affect performance at all, for two reasons:

1) The 'rename' command is very fast since all it does is update the directory -- it doesn't do any file copying.

2) ExifTool would have to create a temporary file then rename afterwards anyway. So in effect, the only difference is that you have to do the rename yourself instead of ExifTool doing it.

I did it purposely this way to make you think twice before overwriting your files.

So I hope you can forgive me... ;-) If enough people feel strongly about this, I will consider changing it.

Direct Responses: 1240 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.