Color Space information from image files (PSD, PSB, AI)

Started by joseph, May 07, 2016, 07:52:57 PM

Previous topic - Next topic

Stephen Marsh

Agreed Phil, I was just typing out my justification for disagreement! :]

Thank you Phil! This is sweet, Adobe don't even offer an out of the box solution for this in Adobe Bridge.

A small point of disagreement, I personally believe that the result of AI9_ColorMode: 1 should be indicated as:

AI Color Model : RGB

Rather than:

AI Color Model : sRGB

As the colour mode/model (RGB) is independent of the specific colour space (sRGB, Adobe RGB 1988, ProPhoto RGB etc). My test file had no ICC profile, so it should not be automatically assumed to be sRGB, it is just "mystery meat" RGB.

Just as AI9_ColorMode: 2 is simply shown as a simple colour mode/model of "CMYK" rather than as a specific colour space name.

Phil Harvey

Yes.  See my previous post.  I'll fix this for 10.94
...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 ($).

StarGeek

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

Phil Harvey

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

Stephen Marsh

Haha:

-if '$AIColorModel eq "RGB"'
-if '$AIColorModel =~ /RGB/'


The great thing about ExifTool (Perl) is it's ability to confound uninitiated users with the flexibility of it's command line syntax!

Phil Harvey

Quote from: Stephen Marsh on April 13, 2018, 11:39:27 AM
The great thing about ExifTool (Perl) is it's ability to confound uninitiated users with the flexibility of it's command line syntax!

We aim to please. ;)
...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 ($).

Hayo Baan

Quote from: Stephen Marsh on April 13, 2018, 11:39:27 AM
Haha:

-if '$AIColorModel eq "RGB"'
-if '$AIColorModel =~ /RGB/'


The great thing about ExifTool (Perl) is it's ability to confound uninitiated users with the flexibility of it's command line syntax!
The two are different though; the first will only match the exact string RGB, the latter any string with RGB in it. So the latter will (also) match sRGB while the first won't :)
Hayo Baan – Photography
Web: www.hayobaan.nl

StarGeek

Quote from: Stephen Marsh on April 13, 2018, 11:39:27 AMThe great thing about ExifTool (Perl) is it's ability to confound uninitiated users with the flexibility of it's command line syntax!

Must... confuse... moar!

-if "index($AIColorModel,'RGB)==0"

It will only match if the tag starts with "RGB", so it won't match "sRGB", but it would match if something followed "RGB".
* 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).

Stephen Marsh

Quote from: Hayo Baan on April 17, 2018, 08:54:48 AM

The two are different though; the first will only match the exact string RGB, the latter any string with RGB in it. So the latter will (also) match sRGB while the first won't :)

Thanks Hayo, just when I thought that I knew what was going on! :]

This is really useful stuff!

Stephen Marsh

Quote from: StarGeek on April 17, 2018, 07:52:20 PM

Must... confuse... moar!

-if "index($AIColorModel,'RGB)==0"

It will only match if the tag starts with "RGB", so it won't match "sRGB", but it would match if something followed "RGB".

So it is the equivalent of a regex of:

^RGB

or do you mean:

\b^RGB\b

StarGeek

More like ^RGB but only because I checked to see if it was equal to 0.  From the Perl docs:

"The index function searches for one string within another, but without the wildcard-like behavior of a full regular-expression pattern match. It returns the position of the first occurrence of SUBSTR in STR..."

By changing it to >=0 it would become the equivalent of /RGB/.  Adding the word boundries \b would be more complicated than it's worth for index.
* 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).