Progress reporting on big batches of files

Started by mpollack, April 28, 2012, 07:12:08 PM

Previous topic - Next topic

mpollack

Hi All,

Does anyone know if there is a way to get exiftool to return some kind of progress update during the processing of batches of images.  I'm using the -v0 option which lets me know that exiftool is still working and shows which files have been processed.  However, I would like it to report back with some kind of count instead.  For example:

======== /Volumes/EOS_DIGITAL/DCIM/100EOS1D/_MG_7357.CR2,  file 1 of 203
======== /Volumes/EOS_DIGITAL/DCIM/100EOS1D/_MG_7358.CR2,  file 2 of 203
======== /Volumes/EOS_DIGITAL/DCIM/100EOS1D/_MG_7359.CR2,  file 3 of 203
.
.
.
======== /Volumes/EOS_DIGITAL/DCIM/100EOS1D/_MG_7560.CR2,  file 203 of 203


The text in red is what I have added to the exiftool output to illustrate what I'm looking for.  If this is not presently doable, is this a feature that could be added in the future?

Thanks in advance,

Michael Pollack
www.untamedimages.com




Phil Harvey

I think that this would require a new option, mainly so the messages would be backward compatible.  Otherwise existing applications calling exiftool would take the new text as part of the file name.

But I don't like adding new options unless there is a very good reason.

Are you calling exiftool from another application?  If so, you could count the files yourself then pass the file names to exiftool instead of the directory names and know exactly how many files will be processed.

- 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 ($).

Phil Harvey

I've been thinking about this.  Maybe it would be a useful option for others, so I am considering adding it.  What about something like this:

>exiftool -progress -artist=me -r tmp
======== tmp/a.jpg [1/4]
======== tmp/b.jpg [2/4]
======== tmp/c.jpg [3/4]
======== tmp/dir1/d.jpg [4/4]


I could make it so the -progress option implies -v0, so you wouldn't have to specify this option too.

I thought about combining this into the -v option by adding a -v00 feature, but I think this would be getting too obscure, and nobody would find it hidden way down there.

- 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 ($).

mpollack

Phil, thanks for your quick responses.

To answer your first post, yes, I am calling exiftool from a bash script so I could pass individual file names to to exiftool and manage the batch progress myself.  To be completely honest, the main reason I haven't done just what you have suggested is that my level of scripting expertise is somewhat lacking, and it would take some effort on my part to understand how to code it properly.  Passing exiftool a directory name is just so convenient!  Also, when I was first playing with this I tried passing one file at a time to exiftool and observed a big slow down in execution.  Now I realize there is probably a workaround using the -stay_open option.

To answer your second post, I would be a happy camper if you decided to implement the "-progress" option that you mentioned.  Is there any way for me to find out if you decide to go forward with this idea (other than reading the release notes for each new revision)?

Phil Harvey

Hi Michael ,

I agree that using directory names is much more convenient.

I've decided to go ahead with the -progress option.  It will appear in ExifTool 8.91.

I have already implemented it in my working version, and I like it.  Thanks for the suggestion.  Adding this option also allows me to add the ability to track the progress while doing things like generating CSV files, for which there was previously no indication that anything was happening until the command was completed -- the new version writes the messages to STDERR instead of suppressing them for options such as -csv.

- 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 ($).

pb

This brings up the next question:  for numbers of files > 9999, should you include a thousands separator?  That would be useful for human readers, but more annoying for programs to parse.  Also, you would probably want to localize it.  But, for me, a mainly human reader of these things, I prefer the thousands separator.

--peter

mpollack

I'm delighted to hear that you are going to include this feature in the next exiftool release.  Thanks for incorporating my suggestion; but above all, thank you for creating exiftool and continually improving this extremely valuable tool for photographers.

Phil Harvey

Peter:  Currently there is no thousands separator, and I think it is better this way.  One main use of this feature will be to allow a calling application to implement a progress bar, and for this you definitely don't want one.

Michael: You're welcome. :)

- 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 ($).