Main Menu

Problem with CSV file

Started by schmekis, March 18, 2023, 06:18:29 AM

Previous topic - Next topic

schmekis

I have followed this perfectly but get the following response from exiftool

C:\Users\john_\Documents>exiftool -csv="C:\Users\john_\Documents\Test1.csv" "C:\Users\john_\Documents\TEST1"
    1 directories scanned
    0 image files read

Any ideas why it says "0 image files read"?

The file was a webp, and I changed it jpg, but still couldn't add the data to the one image in test1.csv

I'm a totally newbie, and could really use some help with this.

schmekis

screenshot of the test csv

source file.jpg 

StarGeek

You are passing exiftool the directory "C:\Users\john_\Documents\TEST1" but your file is in "C:\Users\John_\Documents".

Exiftool uses a CSV file as a lookup table.  If the file is not part of the path that is passed to exiftool, it won't look outside of that directory for the files.

You'll want to use this instead, adding the -r (-recurse) option if there are files in subdirectories to process
exiftool -csv="C:\Users\john_\Documents\Test1.csv" "C:\Users\john_\Documents"

Additional note, that filename is extremely long.  Windows does have a limit on how long the entire filepath can be and you might have other problems with such a long path.
* 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).

schmekis

Can't thank you enough! I was waiting for an alert in my email... that is the reason for the slow response.

It worked. being in a different folder was the issue.  Surprisingly the ridiculously long file name didn't seem to trip it up.

One bonus is it worked with webp

Only issue --- for some reason it did not add the imagealttext

Any thoughts on why the imagealttext is not being added into the webp file?

Phil Harvey

> exiftool a.webp -imagealttext=test
Warning: Tag 'imagealttext' is not defined
Nothing to do.

WebP supports EXIF and XMP tags, so you need to choose one of those to write.

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

schmekis

thanks Phil.

Now I'm going to show my ignorance.  I've read through this other article twice ---- https://exiftool.org/forum/index.php?topic=6433.0  and I'm still at a loss.

It sounds like I need to add the XMP tag ImageAltTag to the config file, but can't find it. For example the only exiftool config files I can find is in two separate geosetter folders, and nowhere else.

Also, based on your response--- is there a separate command then to write to XMP tags? And does that mean I need to do two separate uploads?  I tried deleting the geo exif tags, and used the same write command that succeeded before, but it still didn't work for the imagelalt xmp tag. I thought this is what you were telling me to do... just choose one tag type in the csv. 

Can you provide a little more guidance?


Phil Harvey

In that thread, ImageAltText is a user-defined tag.  This post has instructions on how to make a config file to write this tag.

There is no separate command to write to XMP... you just need to have an XMP tag name in your CSV header.  See the XMP Tags documentation for a list of pre-defined XMP tags.

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

schmekis

It worked.  Only problem is WordPress doesn't use XMP tags. 

Any ideas how I could translate the XMP tag to the field in WP That will render the alt tag like this... <img src="image.jpg" alt="Alternative text here"> ?

StarGeek

Quote from: schmekis on March 21, 2023, 12:29:46 PMIt sounds like I need to add the XMP tag ImageAltTag to the config file, but can't find it.

Understand that even if you create an "ImageAltTag", there isn't a single program out there, other than tools like exiftool and exiv2, that will be able to read the tag. There isn't a standard for an "ImageAltTag".

There is the AlternateTitleText (full name XMP-prism:AlternateTitleText) but I haven't seen any wide spread support for the .

* 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).

StarGeek

Quote from: schmekis on March 21, 2023, 02:10:38 PMAny ideas how I could translate the XMP tag to the field in WP That will render the alt tag like this... <img src="image.jpg" alt="Alternative text here"> ?

You can't force a program to read an images metadata.  If it doesn't read any metadata then there's nothing you can do, other than creating your own WP mod to do so.

You can try testing WP with the test file I created.  Download and extract the "MetadataTestFile.zip" and upload that jpg and see what WP reads.
* 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).

schmekis

Thank you for such quick responses and for being so helpful. 

Here are the results --- https://screenrec.com/share/92StvTsGiO

unfortunately I'm up a creek as it relates to adding the html alt tags that Word press uses. I guess I just had to do three hours of work to figure this out.

schmekis

@StarGeek ---Is your test file exhaustive --- did it make use of every field / tag that exiftool supports?

StarGeek

No, there are plenty of more obscure one that I didn't include. There are pleny of pretty rare ones already in this file. I mostly concentrated on EXIF, IPTC, and XMP tags, as those will be the most common.  MakerNotes, while common, cannot be created and there are very, very few programs which will read them.  Photoshop tags are relatively useless outside of PS and exiftool doesn't write many of them anyway.  ICC_Profile isn't included as that has to be copied as a block and there's no real way to identify it.

With regards to your image, I suspect that the XMP:Headline and XMP:Description will also work.
* 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).

StarGeek

Quote from: schmekis on March 21, 2023, 11:42:02 AMCan't thank you enough! I was waiting for an alert in my email... that is the reason for the slow response.

Notifications aren't on by default.  Otherwise Phil and I would have overflowing emails.

You can turn notifications on a thread by thread basis in the upper/lower right of any thread


Or set the default for your account by clicking your name in the uppper left->Notifications.

Dang it, I had made a graphic for this but it doesn't work with the updated board.  I'm going to post it anyway because I'm pretty happy with it.  I'm going to have to make a new one.



* 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).

schmekis

Ok that's good to know.  Thank you again for your help. Hopefully this will help someone else as well