ExifTool Forum

ExifTool => Newbies => Topic started by: MajoraZ on December 26, 2023, 09:35:42 PM

Title: Exporting embedded color profile information to CSV file/overriding errors
Post by: MajoraZ on December 26, 2023, 09:35:42 PM
Hello!

I apologize in advance if these are dumb questions: using any sort of command line tool is challenging for me, and I've required help from other people outside the forum just to get to where I already am with this!

I'm using

exiftool -csv -f -ProfileDescription -r * > result.csv

To get exiftool to spit out a CSV file containing the information for bunch of files across a web of folders and subfolders, where one of the resulting columns is the name of the embedded color profile of each given file.

This mostly works fine, aside from it having difficulty with specific image files (I have a bunch of image files with names so long most applications have issues reading the file header, or something, exiftool gives a "file not found" error for those; plus some images it tells me have issues with "Text/EXIF chunk(s) found after PNG IDAT (may be ignored by some readers)" or " Possibly incorrect maker notes offsets"; and finally it's having issues with empty text files and zip/rar files, but I don't need those scanned anyways), but I am realizing that even when two image files may have an embedded color profile of the same name, the actual color profile itself may have differences.

For example, two files have seemingly identical color profiles in the CSV file, "Scanner RGB Profile", but importing the files into GIMP show different copyright information tied to the color profile in question.

So:

1. Is there an additional command/tag/whatever (again, I don't use command line much and don't know the terminology!) I can add to the command I listed above that will add more detailed color profile information to additional columns in the resulting CSV file?

I see in this (https://exiftool.org/forum/index.php?msg=20529) and this (https://exiftool.org/forum/index.php?msg=36809) post(s) on the forum, more detailed color profile information can be derived using exiftool, but I'm not sure what exact parts of the command(s) in question I should be adding to mine, if the exact location in the command line matters, and if doing so will add the information to their own columns I can sort independently (IE the name to one column, the copyright metadata field GIMP is displaying to another column, and any other information to their own columns, etc) rather then all just to one combined column.

I tried to look through the documentation myself to see if there is a tag(?)/command(?) for additional color information, and I saw ICC stuff, which those linked posts do also mention, but i'm not sure what I want/need exactly (though i'd rather have too much rather then too little information), especially since despite the fact it obviously works, I didn't see ProfileDescription on any of the documentation pages to begin with.


2. Is there a way to "override" any errors to force exiftool to add the information to the CSV file anyways even for files it detects an error for, or do the errors in question make it impossible for exiftool to analyze them? The files with filenames/paths that are too long and show up as "file not found" errors don't get their results written to the CSV file at all, wheras the files affected by "Text/EXIF chunk(s) found after PNG IDAT (may be ignored by some readers)" or " Possibly incorrect maker notes offsets" errors still are present in the CSV file, though I don't know if the data I want was recorded correctly?

If there's a way to blacklist specific file types/extensions for exiftool to not look at files of, that'd help too.

I do see while looking through the FAQ and documentation that you can use -m to ignore some errors, but I'm not sure if you add that to the initial command or as it runs, and i'm hesitant to do anything that may modify the actual files in question, which I want entirely left as is

Thank you!

**EDIT**:

Also, I did notice a few files have their filenames "split" across two columns of the CSV, with their embedded color profile moved over to a third column as a result.

Lastly, I also saw that at least one file was modified to have "fixed incorrect URI". Is there a way I can UNDO that and tell EXIFinfo not to modify any files I have it check in any way whatsoever?
Title: Re: Exporting embedded color profile information to CSV file/overriding errors
Post by: Phil Harvey on December 27, 2023, 02:04:33 PM
Quote from: MajoraZ on December 26, 2023, 09:35:42 PMexiftool -csv -f -ProfileDescription -r * > result.csv

I would recommend using "." (to represent the current directory) instead of "*" (all files in the current directory). In the command.

QuoteThis mostly works fine, aside from it having difficulty with specific image files (I have a bunch of image files with names so long most applications have issues reading the file header, or something, exiftool gives a "file not found" error for those

I'm assuming you are running under Windows.  Files will special characters may be an issue, but long file names should be OK I would think, if you use "." on the command line.

Quote; plus some images it tells me have issues with "Text/EXIF chunk(s) found after PNG IDAT (may be ignored by some readers)" or " Possibly incorrect maker notes offsets";

You will get lots of warnings like this about problems in various files, but you can ignore them for your purposes.

QuoteI am realizing that even when two image files may have an embedded color profile of the same name, the actual color profile itself may have differences.

You'll have to compare the profiles in these files and determine some other tag that is significant.  (perhaps ProfileDateTime?)  use this command to see all available ICC_Profile tags:

exiftool -s -icc_profile:all FILE

Quote2. Is there a way to "override" any errors to force exiftool to add the information to the CSV file anyways even for files it detects an error for, or do the errors in question make it impossible for exiftool to analyze them?

The best you can do is to save the names of all files giving errors.  You can do it like this ("errors.txt" will be created with the names of files giving errors):

exiftool -csv -f -ProfileDescription -efile errors.txt -r . > result.csv

QuoteIf there's a way to blacklist specific file types/extensions for exiftool to not look at files of, that'd help too.

Add a --ext option for each of these.  (eg. --ext xxx)

QuoteI do see while looking through the FAQ and documentation that you can use -m to ignore some errors, but I'm not sure if you add that to the initial command or as it runs

This won't affect extraction of ICC_Profile information, but it would be done like this:

exiftool -csv -f -ProfileDescription -efile errors.txt --ext xxx -m -r . > result.csv

Quotei'm hesitant to do anything that may modify the actual files in question, which I want entirely left as is

If you do something to accidentally modify the files, then ExifTool will automatically preserve backup copies of the files which can be used to restore the originals.

QuoteLastly, I also saw that at least one file was modified to have "fixed incorrect URI". Is there a way I can UNDO that and tell EXIFinfo not to modify any files I have it check in any way whatsoever?

It isn't modifying anything.  This message indicates that it is fixing these on-the-fly as the file is being read.

- Phil