ICC_Profile tag name information is lost on output

Started by BrianP, March 26, 2017, 12:17:56 PM

Previous topic - Next topic

BrianP

ICC_Profile binary data can be added to a file, but the tag name is altered with essential "ICC" information being lost.

exiftool -b "-icc_profile<=argb.profile.et.icc"  sx-2017.0317-264406.jfn.jpg
exiftool -s -*icc* sx-2017.0317-264406.jfn.jpg | wc
      0       0       0   

The tag just added is not found.  How can this be correct, efficient, user-friendly behavior? 

This down dumbing paraphrasing violates the principles of symmetry and reciprocity by calling the ICC Profile an "icc_profile" during the insertion but labeling it as "ProfileDescription" upon extraction. Is any value added by deleting essential "ICC" data and aliasing "NAME"?

It contravenes the de facto Photoshop standard which uses the succinct and informative ICCProfileName tag.

It breaks with the Phil standard of naming the ExifTool option "-icc_profile".

Breaking down the unwieldy, verbose, "fully qualified" structure:
JPEG_APP2->ICC_Profile->ProfileHeader->ProfileDescription
-> {app2 description header icc jpeg profile}

Grouping:
Junk:             app2,  header
Generic:        description  (imprecise;  ProPhoto is a NAME not a description;  <- a phrase characterizing an object)
Superfluous: jpeg  (.TIFFs and .PNGs can also have ICC_Profiles)
Essential:      icc, profile

All that is left which is significant is ICC and Profile.  Phil's logic in choosing "ICC_Profile" seems inescapable. How did nikon miss it?

How about an option to Retrieve TAGS by the same name with which they were added.
#define   USER_TAGS_OVERRIDE_ARBITRARY_MANGLED_RANDOM_VENDOR_GOBBELDYGOOK    TRUE  :)

================================================================

https://en.wikipedia.org/wiki/ICC_profile
In color management, an ICC profile is a set of data that characterizes a color input
NAME ->               "ICC profile"
DESCRIPTION ->  "a set of data that characterizes a color input"
==================================================

CODE:
#!/bin/bash -v
exiftool -b -JpgFromRaw sx-2017.0317-264406.nef  > sx-2017.0317-264406.jfn.jpg
exiftool -s -all sx-2017.0317-264406.jfn.jpg > sx-2017.0317-264406.jfn.jpg.1.exf
exiftool -s -*icc* sx-2017.0317-264406.jfn.jpg | wc
      0       0       0

exiftool -b "-icc_profile<=argb.profile.et.icc"  sx-2017.0317-264406.jfn.jpg
exiftool -s -*icc* sx-2017.0317-264406.jfn.jpg | wc
      0       0       0
exiftool -s -all sx-2017.0317-264406.jfn.jpg > sx-2017.0317-264406.jfn.jpg.2.exf

dif -e sx-2017.0317-264406.jfn.jpg.?.exf
1 Unique lines from "sx-2017.0317-264406.jfn.jpg.1.exf":
  07) FileInodeChangeDate             : 2017:03:25 11:21:39-05:00

23 Unique lines from "sx-2017.0317-264406.jfn.jpg.2.exf":
  02) BlueMatrixColumn                : 0.14919 0.06322 0.74457
  03) CMMFlags                        : Not Embedded, Independent
  05) ColorSpaceData                  : RGB
  06) ConnectionSpaceIlluminant       : 0.9642 1 0.82491
  07) DeviceAttributes                : Reflective, Glossy, Positive, Color
  08) DeviceManufacturer              : none
  09) DeviceModel                     :
  14) FileInodeChangeDate             : 2017:03:25 11:21:40-05:00
  21) GreenMatrixColumn               : 0.20528 0.62567 0.06087
  25) MediaBlackPoint                 : 0 0 0
  26) MediaWhitePoint                 : 0.95045 1 1.08905
  28) PrimaryPlatform                 : Apple Computer Inc.
  29) ProfileCMMType                  : ADBE
  30) ProfileClass                    : Display Device Profile
  31) ProfileConnectionSpace          : XYZ
  32) ProfileCopyright                : Copyright 1999 Adobe Systems Incorporated
  33) ProfileCreator                  : ADBE
  34) ProfileDescription              : Adobe RGB (1998)  << Mangled tag name DATA Found
  35) ProfileFileSignature            : acsp
  36) ProfileID                       : 0
  37) ProfileVersion                  : 2.1.0
  38) RedMatrixColumn                 : 0.60974 0.31111 0.01947
  39) RenderingIntent                 : Perceptual
====================

exiftool -ver  -> 10.46
uname -a
Linux raptor 4.1.38-50-default #1 SMP PREEMPT Sun Feb 19 14:35:48 UTC 2017 (6b4d8cb) x86_64 x86_64 x86_64 GNU/Linux

Phil Harvey

The ICC_Profile information is extracted as individual tags (add the -G option to your command to see what tags belong to this group).  The full block is only extracted if specifically requested.  I will update the documentation to mention this.

To read it back again as a block, use this command:

exiftool -icc_profile FILE

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

BrianP

Phil,

>> The full block is only extracted if specifically requested
The "Full block" contains almost all junk. Nobody wants to see ADBE or apple computer or PID0
The only interesting chunk, IccProfileName, is entirely missing. Its replacement is maimed with the most essential data, "ICC", destroyed.

Perhaps there is some esoteric reason why this degradation is mandatory. adobe sidestepped the entire problem by using this XMP tag:
======== sx-2017.0317-264406.jfn.ps.prop.jpg  << Photoshop -> Edit -> Convert_to_[ICC]_Profile->Destination=>ProPhoto
[XMP]              ICCProfileName                 : ProPhoto RGB   << NEED TO KNOW! Clear, Informative.
[ICC_Profile]   ProfileDescription              : ProPhoto RGB   << Huh?

Adobe tells the user everything they need/want to see with Photoshop. Perhaps there is a better place than the (obsolete) XMP gang.

How about an option to rescue the only ICC_Profile data users want to see from debasement in the bowels of some arcane structure and show it clearly without obfuscation as Adobe does with Photoshop? The ICC_Profile structure is unchanged AND the user can extract the ~same standard, informative tag they added!

At this point, each user is responsible for  maintaining correct, informative, standard names mapping to poorly selected, dumbed down aliases or embedding the ICC_Profile and then patching the mangled name:

   # Add the ICC_Profile and then fix the name mangling
   if(($cspace=$t2v->{ColorSpace})  &&  $cspace =~ m/adobe RGB/i)  {
      $iccp_tag='ICC_Profile';
      &read_binary_file($adope_icc, \$iccp_bin, $debug);
      ($tnum, $terr)=$et->SetNewValue(
         $iccp_tag=>$iccp_bin, type=>'Raw', Protected=>1);
      print("SEIP: ERROR! SetNewValue($iccp_tag=>$iccp_bin, type=>'Raw') -> ($tnum, $terr)\n\n")
         if($tnum != 1);

      # Add the correct, informative, non-blastardized name for ICC_Profile, IccProfileName!
      ($tnum, $terr)=$et->SetNewValue(ICCProfileName=>'Adobe RGB (1998)');
      print("SEIP: ERROR! SetNewValue(ICCProfileName=>'Adobe RGB (1998)') -> ($tnum, $terr)\n\n")
         unless($tnum == 1); 
      $t2v->{ICCProfileName} = 'Adobe RGB (1998)'  # Use of this code may increase insanity
   }

How much more exciting would _Exif_MEGA_Tool_ be if we could enjoy 139 creative, distinctive pseudonyms for each of 533 possible EXIF tags, one for each "Active/other consumer camera brand" listed on https://en.wikipedia.org/wiki/List_of_digital_camera_brands.

Eskimos may need 50 words for Snow. Do we need (or want) 139 sobriquets for ExposureTime?  :)

    BB