Author Topic: Using Exiftool in a batch file to report metadata from multiple folders  (Read 9623 times)

HaydnWVN

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
Scenario:
Quote
Salesmen 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:

Code: [Select]
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
« Last Edit: March 22, 2012, 12:39:03 PM by HaydnWVN »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16702
    • ExifTool Home Page
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

HaydnWVN

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16702
    • ExifTool Home Page
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

HaydnWVN

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
Thanks!

Alan Clifford

  • ExifTool Freak
  • *****
  • Posts: 469
    • A selection of Alan Clifford's photographs
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

Code: [Select]
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

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16702
    • ExifTool Home Page
You're right, this was FAQ number 2
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

HaydnWVN

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16702
    • ExifTool Home Page
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

HaydnWVN

  • Newbie
  • *
  • Posts: 6
    • Wyevale Nurseries Ltd
Re: Using Exiftool in a batch file to report metadata from multiple folders
« Reply #10 on: March 27, 2012, 07:25:20 AM »
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:

Code: [Select]
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
« Last Edit: March 27, 2012, 08:17:24 AM by HaydnWVN »