Canon Lens Serial Number string

Started by roxie380, December 04, 2012, 05:17:39 PM

Previous topic - Next topic

roxie380

Phil,

WOW - thanks!  Can you sort of tell me how to enter this in the GUI interface, please?

Redirection & Output - I haven't heard those terms in a very long time - gotta did out my old command line books.

Don't laugh, I still haven't figured out how get the output to pause (page) rather than scroll the whole thing - that's why I had to get to to write somewhere......

Phil Harvey

You don't enter the config file in the GUI.  You create a plain text file containing the code I posted, then save this as ".ExifTool_config" in your home directory (or other location as explained in the sample config file I linked in my last post).

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

roxie380

Phil,

I may have mis-understood - you had mentioned earlier that "You can do the cross-reference with the GUI too."  I think it was about five posts back.  Thats why I thought there was some way of doing it in the GUI interface so it would convert the ASCII.


Phil Harvey

Yes.  The config file, properly activated, will apply to the ExifToolGUI as well.  You don't have to do anything in the GUI to get this working.

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

roxie380

Phil,

So if I understand (I hope) - the config file sits in the same directory and the tool (and GUI) - it runs in the background so when I see a Lens Serial Number presented in the Exif data (both from the command line or in running the GUI, it replaces the ASCII with the value I have supplied instead............

Phil Harvey

Close.  The config file should add a new tag called MyLensSerialNumber to the output.  The existing LensSerialNumber tag isn't affected.

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

roxie380

Phil,

Getting close, but -- here is the conf file:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyLensSerialNumber => {
            Require => 'LensSerialNumber',
            ValueConv => '$val',
            PrintConv => {
                '0004269a5' => '4545853',
                '0001c0f94' => '3735253',
                # etc...
            },
        },
    },
);


And here is the command line I am using:

C:\exiftool -config test.Exiftool_config -k -g1 -h -w htm  7Dtest4.CR2


It did add the line in the Composite data: 

My Lens Serial Number   Unknown (00001c0f94)


So, what did I miss?  Should this be in the Canon Maker Notes grouping?  And, apparently the -config option has to be first in the command line?



Phil Harvey

You missed a zero.  It should be 00001c0f94 in the config file, not 0001c0f94.

Yes, the -config option must be first.  But you don't need this option if you put the config file in a standard location.  See FAQ number 11 for help.

This is a Composite tag, so it goes in the Composite group.

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

roxie380

Phil,

Well, that worked great - finally.

So, I put the ExiftoolGUI.exe in the same directory and ran it - don't see any of the "Composite" information, and definitely not the My Lens Serial Number.  All I did to run the GUI was double click on the exe file.  Do I need to add a switch or shortcut to run with the config file?

Also, any way to get the new line, My Len, in the Canon grouping?  I'm not sure I know what the "Composite" is for.

Sorry to be taking so much of your time today.  I do appreciate your patience.

Phil Harvey

You can put the tag in any group you want by adding something like this to the Composite tag definition:

            Groups => { 0 => 'MakerNotes', 1 => 'Canon' },

About the config file in the GUI.  Maybe you could search the GUI section of the forum to see if Bogdan gave any hints about how to do this.

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

roxie380

#25
Phil,

I had done a search over in the GUI forum but no luck on "Composite" - there is an option for showing Composite in "All" but it still isn't showing the new line, My Lens, so I'm guessing its not running the config file.

Is this what you meant by adding the Group def to the Composite?  Probably not since it doesn't work.

So, two issues - how to get GUI to run/see the config file and move the tag to Maker Notes/Canon group.



%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyLensSerialNumber => {
            Require => 'LensSerialNumber',
            ValueConv => '$val',
            PrintConv => {
                '00004269a5' => '4545853',
                '00001c0f94' => '3735253',
                # etc...
      Groups => { 0 => 'MakerNotes', 1 => 'Canon' },      
            },
        },
    },
);

Phil Harvey

Here's where it should go:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyLensSerialNumber => {
            Require => 'LensSerialNumber',
            Groups => { 0 => 'MakerNotes', 1 => 'Canon' },
            ValueConv => '$val',
            PrintConv => {
                '00004269a5' => '4545853',
                '00001c0f94' => '3735253',
                # etc...
            },
        },
    },
);


- Phil

Edit: Reading the GUI documentation, there is a "Show Composite tags in view ALL" option.
...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 ($).

roxie380

Phil,

Getting close, very close.  By putting the Group in the conf file, the tool now puts My Lens Serial Number right below Lens Serial Number, so the ASCII and what is marked on the Lens are adjacent and in the Canon group.

Now, it sure looks like the GUI just doesn't load/run the config file and I'm not sure is adding that -config switch would work.  I'm keeping the GUI exe in the same directory as the tool exe and the .ExifTool_config.

Running the tool works, running the GUI doesn't.

More reading in the GUI forum material..............

Oh, I had edited my previous post since I found the GUI option for including the composite - sorry you had already read the post before I found it.

roxie380

Phil,

Just a thought, do you know if Bogdan runs any "switches" when he executes the tool?

Second, with the Workspace Manger in the GUI, could I add this new field (is it really a new Tag?) to the Workspace?

Phil Harvey

Did you try putting "exiftool.exe" and ".ExifTool_config" both in the c:\windows directory?

Also, the name must be exactly ".ExifTool_config".  How did you rename the file (because I don't think you can do this in Windows without using the command-line "rename" command).

I don't know what switches you mean.  But you should be able to add any tag to the workspace.

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