News:

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

Main Menu

Writing Metadata Tags Using CSV

Started by wildlife_kelly, December 02, 2019, 03:49:23 PM

Previous topic - Next topic

wildlife_kelly

Hi all,

I have read through the forums and am unable to fix my problem so looking for a little guidance.

I am trying to write metadata tags to my camera trap images. The tags are numbers that are hierarchal tags that correspond to species ID (ex. Species ID|999). I plan to use digikam to read my metadata tags only because it is open source. I have a configuration file and csv to import these tags on individual images but have been unsuccessful. I am unsure if I am messing up on my config file, my csv, or my commands.

My config file and csv are attached. Sample code and output below.

exiftool -csv="/users/kellykoriakin/desktop/ex1/j16/tag_data.csv" "/users/kellykoriakin/desktop/ex1/j16/images"

No SourceFile '/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-14(2).JPG' in imported CSV database
No SourceFile '/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-13(1).JPG' in imported CSV database
No SourceFile '/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-16(4).JPG' in imported CSV database
No SourceFile '/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-15(3).JPG' in imported CSV database
No SourceFile '/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-17(5).JPG' in imported CSV database
    1 directories scanned
    0 image files read



exiftool -config /Users/kellykoriakin/Desktop/Ex1/test.config -csv="/Users/kellykoriakin/Desktop/Ex1/J16/tag_data.csv" "/Users/kellykoriakin/Desktop/Ex1/J16/images"
1 directories scanned
    0 image files updated
    5 image files unchanged


I have done a few things to try to trouble shoot--numbered below

1. adding single quotation marks around the  SourceFile file path in my csv.
2. removing the SpeciesID| portion in my tag
3. writing a config file for an XMP tag
4. double check that the sourcefile path is the correct path on my computer
5. removed quotation marks around my csv path and directory to my images in the command line
6. testing the config file
exiftool -SpeciesID=test /users/kellykoriakin/desktop/ex1/test.config
Warning: Tag 'SpeciesID' is not defined
Nothing to do.


I'm struggling but have read all the forums and example codes and cannot seem to figure it out.

I have also provided an image that was coded with a species ID using digikam. Here's the metadata output
======== /users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-15(3).JPG
ExifTool Version Number         : 11.76
File Name                       : J16__2019-09-25__23-25-15(3).JPG
Directory                       : /users/kellykoriakin/desktop/ex1/j16/images
File Size                       : 72 kB
File Modification Date/Time     : 2019:12:02 14:39:48-05:00
File Access Date/Time           : 2019:12:02 15:39:52-05:00
File Inode Change Date/Time     : 2019:12:02 14:44:32-05:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
XMP Toolkit                     : XMP Core 4.4.0-Exiv2
Warning                         : [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto
Categories                      : <Categories><Category Assigned="0">SpeciesID<Category Assigned="1">20</Category></Category></Categories>
Tags List                       : SpeciesID/20
Last Keyword XMP                : SpeciesID/20
Hierarchical Subject            : SpeciesID|20
Catalog Sets                    : SpeciesID|20
Subject                         : 20
Current IPTC Digest             : 163f418ba0767b3e3fad753e5377d01c
Coded Character Set             : UTF8
Keywords                        : 20
Image Width                     : 256
Image Height                    : 256
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 256x256
Megapixels                      : 0.066


Any help or direction would be extremely appreciated. It may be something simple as I'm not the as familiar with computer programming and language but learning as I go.

Thanks in advance!
Kelly

StarGeek

What OS are you on?  Is it a case sensitive filesystem?

The filepaths in your CSV file all have capitalized path names:
/Users/kellykoriakin/Desktop/Ex1/J16/images/J16__2019-09-25__23-25-14(2).JPG

But exiftool indicates that it's looking for lowercase path names:
/users/kellykoriakin/desktop/ex1/j16/images/J16__2019-09-25__23-25-14(2).JPG

If you're on a OS that is case sensitive, this would cause exiftool to not be able to match properly (I think, Phil will have to verify)

Spreadsheets sometimes "Help" by capitalizing letters they think need to be capitalized.

I also think your config file is too bare.  Your tag isn't part of any namespace, though creating brand new tags isn't something I'm that familiar with.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

wildlife_kelly

Hi StarGeek,

Thanks for the reply! I am using a MacOS mojave.

I did update the case sensitive (I always forget this for some reason) part of my commands and the error concerning SourceFile is no longer appearing but it is not updating any of the images.

exiftool -csv="/Users/kellykoriakin/Desktop/Ex1/J16/tag_data.csv" "/Users/kellykoriakin/Desktop/Ex1/J16/images"
1 directories scanned
    0 image files updated
    5 image files unchanged


It is searching the correct directory as there are 5 images in this directory. Thanks for the simple fix there!

I guess I don't really understand how to create new tags. I tried to copy some of the other examples and have been unsuccessful. Attached is the XMP config file I tried to write--again... I must not understand the basics of writing a config?

Thanks again for the help!

Phil Harvey

Your CSV file attempts to write a tag named SpeciesID, but you have not defined that tag in your config file.  Otherwise, your config file looks OK.

Try adding the -v2 option to your command to get more information about what is happening.

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

wildlife_kelly

Brilliant! I apologize for the extremely basic questions. I tend to resolve one problem and make a mistake on anothe-- I appreciate the response and patience!

The code is working! Yay!!

Kelly