News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Using Exiftool in a batch file to report metadata from multiple folders

Started by HaydnWVN, March 22, 2012, 10:04:55 AM

Previous topic - Next topic

HaydnWVN

Scenario:
QuoteSalesmen have a vast directory of images used for promotion, product labels and uploading to web. Someone previously saved an image for a product from the web (after being advised not to), that makes it onto promotional material online. The original author identifies the image by it's metadata and makes an illegal useage complaint (or fine).

I'm producing a report of all metadata contained in certain tags from a whole network volume, consolidated into a single CSV so i can easily highlight which images are identified as copyrighted (also seeing which we've taken ourselves).

I'm using the following in my batch file:

exiftool.exe -csv -r M:\Images\Labels\*.* -FILENAME -COPYRIGHT -URL -AUTHORS -COMPANY -CREATORS -CAMERA >> C:\Users\me\Desktop\metadata_list.csv

But it does not seem to be working recursively... Any tips/hints?

Thanks

Phil Harvey

The -r option only works if you specify a directory name.  Instead of M:\Images\Labels\*.*, you should use M:\Images\Labels.

Note that the -csv option is very memory intensive if you run on a very large number of files.  On most operating systems this should be a problem, but in Windows the memory contraints are more severe.

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

HaydnWVN

Thanks for the quick response Phil, was just coming back to say i'd sorted it! Newbie mistake! Glad i posted it here ;)

As it's a network location and currently at 20K+ files, i'm more than happy by memory/cpu intensity, but what about network traffic?

Fairly busy network here with multiple things running on 4 servers... Folder with the images is on Ubuntu (+samba) with Windows workstations, ideally i'd be running this from my machine (processing done locally, yet high traffic?), but i could do it from the server (processing done on server, more of an impact to others, but quicker speed?)

Phil Harvey

Adding the -fast option will significantly reduce the amount of data transferred over the network for JPG images.

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


Alan Clifford

HaydnWVN, just curious as to your chosen tags.  There are maybe more that you should add to look for owners. Looking at the tags I use that have my name in, I get

Artist                          : Alan Clifford
Copyright                       : (c) Alan H. Clifford, 2011
User Comment                    : Email:  alan@clifford.ac
By-line                         : Alan Clifford
Copyright Notice                : (c) Alan H. Clifford, 2011
Creator Work Email              : alan@clifford.ac
Creator Work URL                : http://www.clifford.ac
Creator                         : Alan Clifford
Rights                          : (c) Alan H. Clifford, 2011
Comment                         : Copyright:  Alan H. Clifford.Email:  alan@clifford.ac.Rubric:  Young greater kudu

HaydnWVN

Thanks Alan, i'm revising as i go!

How do i include tags with a space into my command? Will ExifTool understand "tags with quotes"?
(i know this is probably in the FAQ, but i didn't spot it yesteday!)

Phil Harvey

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

HaydnWVN

Thanks Paul!

Another couple of related questions...

UNC paths all ok? If so then how about websites themselves, is the recursive search powerful enough to get directory listings of webservers? :)

Phil Harvey

I think that UNC paths should work, but I can't try this myself.

If the directory looks like a normal filesystem, then exiftool should be able to deal with it.  I'm not sure how you are accessing the webserver.

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

HaydnWVN

Phil: For your records (don't really need a solution for these), UNC paths don't seem to work from within my batch file, i've had to map the shares i wanted to 'index' to drive letters.

Indexing a webserver doesn't work (imagine its a permissions/location thing) as it doesn't work on my intranet webserver either (where i've got inherited ownership) :)

Here's an update to the tags i'm reading:

exiftool.exe -csv -fast -r M:\Images\* -FILENAME -COPYRIGHT -COPYRIGHTFLAG -URL -AUTHORS -COMPANY -FILESOURCE -CREATOR -ARTIST -RIGHTS -CREATORWORKURL -WEBSTATEMENT -OWNERNAME -USAGETERMS -PROFILECOPYRIGHT -COPYRIGHTNOTICE -BY-LINE -CANONMODELID -CAMERA -MAKE -MODEL -SOFTWARE -CREATORTOOL >> C:\Users\me\Desktop\images_list.csv