Canon Lens Serial Number string

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

Previous topic - Next topic

roxie380

Phil,

Do you know what data string the tool is reading when it present "Lens Serial Number?"  When I look at "All" data with the GUI, I do see a Lens Serial Number but it appears to be some sort of HEX data.  I've tried using a converter but the decimal data does not come anywhere near the lens serial number.

I know this may have been discussed before but the tool is reading some string, and it does change with the lens.  I had two copies of the Canon 24-105 and each one gave a different entry in the Lens Serial Number field.  For example, Lens (21)0454585 produces 0004269a5 and lens (21) 03735253 shows 0001c0f94.  Its the same lens type so we must be reading some data; I just can't figure out what.

Thanks for looking at this.

Phil Harvey

If you consult the Canon tag name documentation, you should find your answer.

- 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 looked at the Canon Tags reference you supplied and I'm still puzzled.  Maybe I just don't know what you wanted me to see.  If the Lens Serial Number is actually in the EXIF data, and I'm seeing a string, be it hex or some other format, how does it convert to the actual lens serial number in true decimal?  I've tried every conversion I can think of ........ what am I missing?

Sorry to seem so dense.

Thanks

Phil Harvey

Did you see this?:



0LensSerialNumberundef[5](apparently this is an internal serial number because it doesn't correspond to the one printed on the lens)

- 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 had not seen that - I don't have much experience reading these Canon tag tables and sub-linked tables.

Is that the string that EXIT Tool is presenting when it shows "All" Lens Serial Number?

Do I understand there is no direct relationship to the real (printed) serial number?  If this internal number is constant, could I make a manual cross-reference chart, or is there a way to do that in the tool?

Thanks for sticking with me on this!

Phil Harvey

Quote from: roxie380 on December 05, 2012, 08:05:28 AM
Is that the string that EXIT Tool is presenting when it shows "All" Lens Serial Number?

I can't say.  Use the -G1 option, and if the group is "Canon", then the answer is yes.

QuoteDo I understand there is no direct relationship to the real (printed) serial number?  If this internal number is constant, could I make a manual cross-reference chart, or is there a way to do that in the tool?

You could do the cross-reference with a user-defined Composite tag if you want, with a PrintConv that converts from internal to external serial number.

- 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

WOW - thanks.

Too bad Bogdan isn't supporting the GUI any more.  What you suggested is probably way beyond my understanding.

Thanks for the information ----- and the continued support of the tool.  It takes a lot of work, but I want you to know its very much appreciated.

roxie380

#7
Phil,

Well, the mystery continues.  I ran the tool with the following  "exiftool -k -g1 1.jpg" and the Lens Serial Number appears in the line just before the Canon grouping.  The last three lines before the Canon grouping are: Lens Info, Lens Model, Lens Serial Number.

So, I don't think this is coming from the Maker notes.

Also, in the GUI run, the Lens Serial number does not show when I select "Maker" - it does appear in "Exif" and "All" but not "Maker."

I would have thought you were right based on the Canon tag data, but this is getting strange.  The tool is reading the data - just don't know where.

Any suggestions?




Thanks

Phil Harvey

#8
OK, more information would be useful at this point.  What camera model, and did you edit the JPEG with any other software?

- Phil

edit: Of course a sample image would answer all questions.  You can email it to philharvey66 at gmail.com
...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

#9
Phil,

I have Canon EOS 5D MK III.  The images are straight out of the camera, right from the card and it makes no difference if they are jpeg or CR2 files.  If you want I can send you one jpeg to read the data if you wish.

At one point I was sure I was seeing this on the Canon 7D, too, but can't see it now.

Thanks

Phil Harvey

#10
This is helpful, thanks.

My 5DmkIII CR2 and JPG samples have an ExifIFD:LensSerialNumber.  This is an ASCII string written by the camera in the standard EXIF metadata.  It isn't in the Canon maker notes as with some other models.

However, in my 5DmkIII MOV video sample, there are 2 LensSerialNumber tags.  One in the ExifIFD, and one in the Canon MakerNotes.  Both have the same value, and I'm guessing that neither corresponds to the printed serial number on the lens itself.

- Phil

Edit:  I just checked my 7D samples.  Firmware 3.7.5 (pre-production) didn't write a LensSerialNumber.  Firmware 1.0.8 writes LensSerialNumber in the MakerNotes.
...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,

Gotta love the manufactures.  Was what you saw on the 7D called "internal serial number?"  I just checked some of my older images - firmware version 1.0.8 did, 1.2.3 did, 1.25 did, but firmware 2.0.0 and the  current firmware firmware does not show the "internal serial number."

And, now we know the lastest version of the 5D MK III does show "Lens Serial Number."  Guess its like "stay tuned for the lastest change!"

You say this is an ASCII string.  Guess I was confused when I saw it had "letters" and thought hexidecimal.

Since it is constant, you mentioned a way to build a cross-reference to the actual lens serial number.  I'm guessing that would not work in the EXIF tool GUI interface?

Thanks for helping me solve this mystery.  And for the great support of the tool!!

Phil Harvey

My 7D firmware 3.7.5 and 1.0.8 samples do have an InternalSerialNumber in the MakerNotes, but this (presumably) is for the body.  I was talking about LensSerialNumber in my last post.

You can do the cross-reference with the GUI too.  It is done with the config file.  I can provide an example later when I have more time.

- 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,

Yep,you're right - it is the Lens Serial Number.  I would very much appreciate an example of how to cross-reference the ASCII to the real serial number when you have time.

Just so you know why I was trying to figure this data string out - a friend gave me his 24-105 to test with mine.  After shooting for a while, and switching lenses, started to look at the images and figure out which ones were shot with his 24-105 or mine.  Noticed the "Lens Serial Number" but it didn't relate to the number on either lens.  Finally just shot one image with one lens and noted the ASCII string.  And been scratching my head ever since.

By the way, not being command-line smart, it took me a long time to figure out how to get a readable html file.  On your home-page, you show an example of an html output using "exiftool -h -canon pics/IMG_0315.jpg"      Would it be helpful to other novices to show that as "exiftool -h -w htm -canon pics/IMG_0315.jpg"  I kept reading about the -w switch but it kept saying "text output" until I finally tried the -w htm

Anyway, just a thought cause I kept trying the way it was shown in your example and got nothing.  Maybe I was just doing it wrong.

Looking forward to you example of a cross-reference, hopefully you will have time to show me in both just the tool and the GUI.  (Any updates from Bogdan?  Hope he is ok.)

Thanks

Phil Harvey

The config file to do what you want would look something like this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyLensSerialNumber => {
            Require => 'LensSerialNumber',
            ValueConv => '$val',
            PrintConv => {
                '0000130aff' => 'The actual serial number',
                '0000154321' => 'The other serial number',
                # etc...
            },
        },
    },
);


see the sample config file for instructions on activating a config file.

All text output (HTML is a form of text) from the command-line application goes to the console by default.  As you discovered, the -w option may be used to write this to a file, but the more usual way to do this is using the shell redirection feature, like this:

exiftool -h a.jpg > out.html

This isn't explained in detail in the ExifTool documentation because it is a feature of the shell, not exiftool, but it does appear in some of the examples.

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