Author Topic: append base file name to labels  (Read 7941 times)

rparmar

  • Newbie
  • *
  • Posts: 7
append base file name to labels
« on: June 23, 2011, 09:53:22 PM »
I am new to this tool and my command-line days lie behind me. I simply want the image file name added to the list of keywords in the meta data. Neither of the following seem to work, giving me the warning "Warning: [minor] Error reading value for ImageProcessingIFD entry 146"

exiftool" "-exif:XPKeywords+<%f" E6231668.orf
exiftool" "-keywords+<%f" E6231668.orf

The keywords I hope I am changing are those as reflected in the Keyword List hierarchy in Lightroom. Maybe I am totally in the wrong place.

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #1 on: June 23, 2011, 09:54:30 PM »
P.S. I see now that the very next thread is a variation on the same question. I guess I should have refreshed my browser since landing here!

PH Edit: Added link to the other thread
« Last Edit: November 18, 2011, 12:31:38 PM by Phil Harvey »

concord977

  • Newbie
  • *
  • Posts: 2
    • Photos on Smugmug.com
Re: append base file name to labels
« Reply #2 on: June 23, 2011, 11:31:19 PM »
I'm a newbie, but I had some success using the following command:

exiftool "-IPTC:keywords<filename" E6231668.orf

However, it replicated the same effect I reported in the other thread ... that the file extension carried over.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Re: append base file name to labels
« Reply #3 on: June 24, 2011, 07:09:04 AM »
This is what you want:

exiftool "-iptc:keywords+<filename" ...

or use MWG:Keywords instead of IPTC:Keywords for better compatibility (see the MWG tag name documentation for details).

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

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #4 on: June 24, 2011, 09:21:18 AM »
OK, so I tried that and it said the MWG keyword was not supported. Using iptc:keywords it was still not touching the file.

I converted the proprietary ORF image files I was using to standard DNG. This is better for all sorts of reasons, not least of which I can have more faith in their standard.

I decided to reinstall exiftool since my copy might be out of date. I downloaded the executable but it does not unpack, giving this error (Where USER is my user name):
Error running more C:\Users\USER\AppData\Local\Temp\par-USER\\exiftool_doc.txt

OK, so back to the version I have, which is a bare-bones naked EXE. I figured maybe I need the configuration file in place, so I copied the text of what I could find on your website to a file called config.cfg, put this in the exiftools folder and ran this command line:
"PATH\exiftool" -config "PATH\config.cfg" "-iptc:keywords+<filename" E6231667.dng

Here is the output:
Warning: Bad ImageProcessingIFD offset for tag 0x1104 - E6231667.dng
Warning: Error rebuilding maker notes (may be corrupt) - E6231667.dng
No XMP HASH(0x2de8e0c) structure!
Warning: [minor] Ignored empty rdf:Alt list for dc:description - E6231667.dng
Error: [minor] Bad ImageProcessingIFD offset for tag 0x1104 - E6231667.dng
    0 image files updated
    1 files weren't updated due to errors


The file does indeed have pre-existing keywords. I can see these in Lightroom and GeoSetter, which uses exiftool under the hood. That app can set keywords without a problem once I manually enter the file name.

At this point I am stumped again.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Re: append base file name to labels
« Reply #5 on: June 24, 2011, 10:40:40 AM »
OK, so I tried that and it said the MWG keyword was not supported.

Please update to a more recent version of ExifTool.  The MWG feature was added almost 2 years ago in version 7.98.

Quote
I downloaded the executable but it does not unpack, giving this error (Where USER is my user name):
Error running more C:\Users\USER\AppData\Local\Temp\par-USER\\exiftool_doc.txt

Please try re-downloading and re-installing after erasing the files in your C:\Users\USER\AppData\Local\Temp\par-USER directory.

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

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #6 on: June 24, 2011, 12:42:08 PM »
I did that but the installer gives the same error. The double backslash seems to be a syntax problem, no?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Re: append base file name to labels
« Reply #7 on: June 24, 2011, 12:49:59 PM »
The double backslash may explain why it can't load the help file (but I don't understand it), but what is the error when you try to actually do something?

Does it create the "C:\Users\USER\AppData\Local\Temp\par-USER\exiftool-8.59" directory as it should?

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

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #8 on: June 24, 2011, 01:20:32 PM »
It creates C:\Users\USER\AppData\Local\Temp\par-USER\cache-exiftool-8.59\ with the extra cache- in there. Inside is an executable exiftool(-k).exe but it won't run from the command line with that name. There are also 8 dll files and a whole bunch of pm files. Also an inc folder with many hundreds of folders and files. Is this as it should be?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Re: append base file name to labels
« Reply #9 on: June 24, 2011, 01:35:06 PM »
It creates C:\Users\USER\AppData\Local\Temp\par-USER\cache-exiftool-8.59\ with the extra cache- in there.

Right, good.   I forgot about the extra "cache-".  I just wanted to verify that exiftool had the ability to write files in the temporary directory.

Quote
Inside is an executable exiftool(-k).exe but it won't run from the command line with that name. There are also 8 dll files and a whole bunch of pm files. Also an inc folder with many hundreds of folders and files. Is this as it should be?

This sounds correct.  So what is the error if you run it on an image?  (not run from the temporary files, but from the executable file you downloaded)

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

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #10 on: June 24, 2011, 02:32:06 PM »
OK, ignoring the cache and simply running the exe as downloaded I used this command line:
"D:\downloads\exiftool-8.59\exiftool(-k)" "-MWG:Keywords+<filename" E6231667.dng

This is the output:
Warning: Bad ImageProcessingIFD offset for tag 0x1104 - E6231667.dng
Warning: [minor] Ignored empty rdf:Alt list for dc:description - E6231667.dng
Error: [minor] Bad ImageProcessingIFD offset for Olympus_ImageProcessing_0x1104
- E6231667.dng
    0 image files updated
    1 files weren't updated due to errors


P.S. thanks for all your help!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Re: append base file name to labels
« Reply #11 on: June 24, 2011, 06:58:49 PM »
OK, now we're getting somewhere.

Use the -m option to ignore the minor errors and allow the image to be written.

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

rparmar

  • Newbie
  • *
  • Posts: 7
Re: append base file name to labels
« Reply #12 on: June 24, 2011, 08:54:56 PM »
OK, that works!  :)

(Except I should be using basename not filename. And it still displays the two Warnings.)

Lightroom does not show the results immediately, but when I "read metadata from file" it updates its database and hence the display. From now on I'll be doing this as a batch before importing, so that won't be an issue.