News:

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

Main Menu

Displaying descriptive (enumerated) tag values

Started by kardster, March 26, 2013, 07:26:29 PM

Previous topic - Next topic

kardster

I am trying to use the exiftool.exe utility to display unknown and misreported tag names and values that are specific to my camera model.  I am able to set the tag names but cannot figure out if/how to change the default values to something more meaningful.  For example, The MakerNote tag 0x0048 for my Panasonic camera defines the Flash Curtain used when the flash fired: 0 = no flash, 1 = 1st curtain, 2 = 2nd curtain.  I have defined the following in the the .exiftool_config file:


%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Panasonic::Main' => {
        0x0048 => {
            Name => 'FlashCurtain',
            Writable => 'int16u',
            WriteGroup => 'Panasonic',   # not sure if this is needed or proper
        },
    },
};
%Image::ExifTool::UserDefined::Options = (
    Unknown => 1,           # retrieve unknown tags);

#------------------------------------------------------------------------------
1;  #end



I've also determined that if I change an existing "known" tag per the above method, the descriptive value is lost and replaced by the base data type value. 

Is it possible to return the values "N/A", "1st", & "2nd" instead of 0, 1, & 2?  I'm not interested in changing the data in the files - just displaying the metadata in a more meaningful manner for use by ExifToolGUI.

Phil Harvey

Quote from: kardster on March 26, 2013, 07:26:29 PM
I've also determined that if I change an existing "known" tag per the above method, the descriptive value is lost and replaced by the base data type value. 

I don't understand.

[/quote]Is it possible to return the values "N/A", "1st", & "2nd" instead of 0, 1, & 2?[/quote]

Yes.  Also, the WriteGroup is not necessary for maker notes tags:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Panasonic::Main' => {
        0x0048 => {
            Name => 'FlashCurtain',
            Writable => 'int16u',
            PrintConv => {
                0 => 'N/A',
                1 => '1st',
                2 => '2nd',
            },
        },
    },
};
%Image::ExifTool::UserDefined::Options = (
    Unknown => 1,           # retrieve unknown tags
);
#------------------------------------------------------------------------------
1;  #end


But please, share your discoveries about the Panasonic maker notes so other people may benefit from your work.  Post your decoding here and I will add it to ExifTool.

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

kardster

Thanks Phil - your suggested modification worked like a champ!

Below is my updated .exiftool_config file with personal changes pertaining to my Panasonic DMC-FZ200.  (With the exception of the new Scene Modes 62-64, these pertain to the DMC-FZ150 as well.)  I've highlighted preceded with ">>" what I believe is new (or at least camera-specific) information when comparing my image metadata to the Panasonic Maker Notes from:
http://www.exiftool.org/TagNames/Panasonic.html.


#------------------------------------------------------------------------------
# File:         ExifTool_config  -->  ~/.ExifTool_config
#
# Description:  Sample user configuration file for Image::ExifTool
#
# Notes:        This file is specific to the Panasonic DMC-FZ150/200
#
#------------------------------------------------------------------------------

# Shortcut tags are used when extracting information to simplify
# commonly used commands.  They can be used to represent groups
# of tags, or to provide an alias for a tag name.
%Image::ExifTool::UserDefined::Shortcuts = (
    MyShortcut => ['exif:createdate','exposuretime','aperture'],
    MyAlias => 'FocalLengthIn35mmFormat',
);

# NOTE: All tag names used in the following tables are case sensitive.

# The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.
%Image::ExifTool::UserDefined = (
    # All EXIF tags are added to the Main table, and WriteGroup is used to
    # specify where the tag is written (default is ExifIFD if not specified):
    # 'Image::ExifTool::Exif::Main' => {
    'Image::ExifTool::Panasonic::Main' => {
        0x0024 => {
            Name => 'Flash Bias',
            Writable => 'int16u',
            PrintConv => {
                -6 => '-2 EV',
                -5 => '-1 2/3 EV',
                -4 => '-1 1/3 EV',
                -3 => '-1 EV',
                -2 => '-2/3 EV',
                -1 => '-1/3 EV',
                 0 => '0 EV',
                 1 => '+1/3 EV',
                 2 => '+2/3 EV',
                 3 => '+1 EV',
                 4 => '+1 1/3 EV',
                 5 => '+1 2/3 EV',
                 6 => '+2 EV',
            },
        },
        0x002a => {
            Name => 'BurstMode',
            Writable => 'int16u',
            PrintConv => {
                0 => 'Off',
                1 => 'On',
>>              2 => 'Auto Exposure Bracketing (AEB)',
                4 => 'On',
            },
        },
        0x002e => {
            Name => 'SelfTimer',
            Writable => 'int16u',
            PrintConv => {
                1 => 'Off',
                2 => '10 s',
                3 => '2 s',
>>              4 => '10 s / 3 pictures',
            },
        },
>>      0x0048 => {
            Name => 'FlashCurtain',
            Writable => 'int16u',
            PrintConv => {
                0 => 'None',
                1 => '1st',
                2 => '2nd',
            },
        },
>>      0x0089 => {
            Name => 'PhotoStyle',
            Writable => 'int16u',
            PrintConv => {
                0 => 'Auto',
                1 => 'Standard or Custom',
                2 => 'Vivid',
                3 => 'Natural',
                4 => 'Monochrome',
                5 => 'Scenery',
                6 => 'Portrait',
            },
        },
        0x8001 => {
            Name => 'SceneMode',
            Writable => 'int16u',
            PrintConv => {
                 0 => 'Off',
                 1 => 'Normal',
                 2 => 'Portrait',
                 3 => 'Scenery',
                 4 => 'Sports',
                 5 => 'Night Portrait',
                 6 => 'Program',
                 7 => 'Aperture Priority',
                 8 => 'Shutter Priority',
                 9 => 'Macro',
                10 => 'Spot',
                11 => 'Manual',
                12 => 'Movie Preview',
                13 => 'Panning',
                14 => 'Simple',
                15 => 'Color Effects',
                16 => 'Self Portrait',
                17 => 'Economy',
                18 => 'Fireworks',
                19 => 'Party',
                20 => 'Snow',
                21 => 'Night Scenery',
                22 => 'Food',
                23 => 'Baby',
                24 => 'Soft Skin',
                25 => 'Candlelight',
                26 => 'Starry Night',
                27 => 'High Sensitivity',
                28 => 'Panorama Assist',
                29 => 'Underwater',
                30 => 'Beach',
                31 => 'Aerial Photo',
                32 => 'Sunset',
                33 => 'Pet',
                34 => 'Intelligent ISO',
                35 => 'Clipboard',
                36 => 'High Speed Continuous Shooting',
                37 => 'Intelligent Auto',
                39 => 'Multi-aspect',
                41 => 'Transform',
                42 => 'Flash Burst',
                43 => 'Pin Hole',
                44 => 'Film Grain',
                45 => 'My Color',
                46 => 'Photo Frame',
                51 => 'HDR',
                55 => 'Handheld Night Shot',
                57 => '3D',
                59 => 'Creative Control',
>>              62 => 'Panorama',
>>              63 => 'Glass Through',
>>              64 => 'HDR',
                66 => 'Digital Filter',
             },
         },
    },
);

# Specify default ExifTool option values
# (see the Options function documentation for available options)
%Image::ExifTool::UserDefined::Options = (
    Unknown => 1,           # include unknown tags
);

#------------------------------------------------------------------------------
1;  #end


What I meant by:
QuoteI've also determined that if I change an existing "known" tag per the above method, the descriptive value is lost and replaced by the base data type value.

was that if I included a known tag - such as 0x0028 (ColorEffect) - but wanted to change its tag name to match a camera's specific control name such as "ColorStyle", for example, the values returned change from using one of "Off|Warm|Cool|Black & White|Sepia|Happy" to the numeric values 1-6 instead - forcing me to not only change the tag name but also know and list all enumerated values [some of which I may not know].

And, finally, a new, related question:  What would I modify to change a numeric (non-enumerated) value such as aperture number to include the "f/" prefix?  i.e. Change 5.2 to "f/5.2" without having to list every possible f-number (which may be impossible!).

Phil Harvey

Thanks for your config file.  I'll implement what I can in ExifTool and post here if I have any questions after I have done this.
Quote from: kardster on March 27, 2013, 10:36:25 AM
I included a known tag - such as 0x0028 (ColorEffect) - but wanted to change its tag name to match a camera's specific control name such as "ColorStyle", for example, the values returned change from using one of "Off|Warm|Cool|Black & White|Sepia|Happy" to the numeric values 1-6 instead - forcing me to not only change the tag name but also know and list all enumerated values [some of which I may not know].

Right.  There is no way to override just one of a tag's properties without overriding them all.

QuoteWhat would I modify to change a numeric (non-enumerated) value such as aperture number to include the "f/" prefix?  i.e. Change 5.2 to "f/5.2" without having to list every possible f-number (which may be impossible!).

You can do it like this:

        PrintConv => '"f/$val"',
        PrintConvInv => '$val =~ s{f/}{}; $val',


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

kardster

Thanks again.

I've also noted that tag 0x000f - AFAreaMode value '32 0' is reported for either Focus Tracking or Face Detection for the DMC-FZ200.

Phil Harvey

I combined in your discoveries, thanks.  They will appear in version 9.25.

I don't know about the '32 0' AF mode.  Perhaps it would be better called 'Tracking', or something like that.  For now I'll leave it alone.

I changed the decoding of FlashBias to divide by 3 as you are doing, although I think that older models likely don't use the factor of 3, but I have no way to tell which models do and which models don't, so I might as well use your decoding, which is presumably used by more recent models.  I have often seen inconsistencies like this, and it is a real pain.

Please let me know if you discover anything else.

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

kardster

#6
QuoteI don't know about the '32 0' AF mode.  Perhaps it would be better called 'Tracking', or something like that.  For now I'll leave it alone.

Yeah - looks like this gets set to '32 0' for any tracking - be it user-initiated via AF Lock or face-detected.


While looking at making the JPEG rendering options match the FZ150/200, I found that the Noise Reduction still matches the odd pattern you've documented but the other three parameters are only documented for zero.  This tag field type may be int16u, but the values reported appear to be 2's complement:

0x0039: Contrast
0x0040: Saturation
0x0041: Sharpness

(Sorry- I couldn't get the Table option to show this properly)
Camera Setting, Reported Value
-2            , 65534
-1            , 65535
0            , 0
+1            , 1
+2            , 2


Actually, I just realized you may already have this covered as those values were reported when I replaced the tag definition in my .exiftool_config file...Sorry!

Phil Harvey

Quote from: kardster on March 28, 2013, 09:42:42 AM
While looking at making the JPEG rendering options match the FZ150/200, I found that the Noise Reduction still matches the odd pattern you've documented but the other three parameters are only documented for zero.  This tag field type may be int16u, but the values reported appear to be 2's complement:

0x0039: Contrast
0x0040: Saturation
0x0041: Sharpness

Yes.  All of these are stored as int16u (the "Writable" format), but read as int16s (the read "Format").  It is not uncommon to see incorrect EXIF types like this in the maker notes.

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