Canon Lens Serial Number strings

Started by TechnoPhil, November 01, 2014, 01:29:23 PM

Previous topic - Next topic

TechnoPhil

Hello Phil,
it's a long time I am using exiftool and I have never understood why the "Lens Serial Number" shown is different from my actual lens serial number.
For example:

exiftool /temp/IMG_6184.CR2 | grep Serial

Internal Serial Number       : GD0040687
Serial Number                   : 023022003733
Lens Serial Number            : 0000204d8d

What is the "Internal Serial Number" ?
The serial number of the Digital camera is correct, but my actual lens serial number is 45842 ... how can I convert the number 0000204d8d shown in the exif data? This number is not Hexadecimal!

Please help me!
Thanks!  ;)

Hayo Baan

Many camera manufacturers encrypt the actual serial number of the camera. It is the encrypted number Exiftool is able to show, showing the actual serial would require a known encryption method, but alas this is usually a trade secret and hence unknown :(
Hayo Baan – Photography
Web: www.hayobaan.nl

TechnoPhil

@ Hayo Baan

Thank you for your answer!
Waiting for Phil in order to receive another confirmation!  ::)

Phil Harvey

Add the -G1 option to your output.  If this is the standard EXIF tag, then the answer is that the camera isn't writing the string properly.  If it is a Canon tag, please send me a sample and I'll take a look (philharvey66 at gmail.com).

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

TechnoPhil


Phil Harvey

I got the file, thanks:

> exiftool ~/Desktop/IMG_36176_6d.JPG "-*serial*" -G1
[Canon]         Internal Serial Number          : GD0040687
[ExifIFD]       Serial Number                   : 023022003733
[ExifIFD]       Lens Serial Number              : 0000204d8d


The ExifIFD serial number is written incorrectly.  This standard EXIF tag should not be encrypted, so it must be considered a Canon bug that it is not stored properly.  (If it is encrypted somehow, I don't know how, but then ExifTool wouldn't decrypt it anyway since it is a standard EXIF tag.)

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

TechnoPhil

Thank you for your opinion Phil!
I will write to Canon USA in order to investigate to that issue.

I will keep you informed.
Regards  ;)

Hayo Baan

Interesting! Seems I may have been wrong about the "many" at least; taking a closer look at the sample images I have available it looks like at least Nikon and Canon have the camera serial number unencrypted. Regarding the lens serial number I can not determine this; Nikon does not seem to record this (or at least not yet in a known tag) and the Canon gear I shoot with that does, records it as 0000000000, but that is likely be because it is a non-Canon lens I used.

@TechnoPhil, are you by any chance also using a non-Canon lens?

@Phil: I noticed that for the Nikon D70, the serial number is written as "NO= xxxxxxxx", perhaps it would be nice to strip off the NO= part?
@Phil: I also noticed that the Nikon D200 doesn't seem to record the serial number in the makernotes, even though the tag is available...
Hayo Baan – Photography
Web: www.hayobaan.nl

TechnoPhil

@ Hayo Baan

Sorry, but I only have one lens: EF 28-300 L

Hayo Baan

#9
Quote from: Hayo Baan on November 02, 2014, 11:44:20 AM
Interesting! Seems I may have been wrong about the "many" at least; taking a closer look at the sample images I have available it looks like at least Nikon and Canon have the camera serial number unencrypted. Regarding the lens serial number I can not determine this; Nikon does not seem to record this (or at least not yet in a known tag) and the Canon gear I shoot with that does, records it as 0000000000, but that is likely be because it is a non-Canon lens I used.

@TechnoPhil, are you by any chance also using a non-Canon lens?

@Phil: I noticed that for the Nikon D70, the serial number is written as "NO= xxxxxxxx", perhaps it would be nice to strip off the NO= part?
@Phil: I also noticed that the Nikon D200 doesn't seem to record the serial number in the makernotes, even though the tag is available...

Right, now I remember again why I said that many manufacturers encrypted the number: over the course of years I have shot with a number
of different Canon 60D camera's (they rotate these between a group of photographers for specific assignments), two of these (ones I used for a long time) showed a weird negative number as serial number. The problem is that I now do not have access to these specific cameras any longer (at least I'm not sure which ones they should be) so I can not determine what the number should have been (perhaps simply the unsigned integer version?).
I noticed that the camera with the negative number used a slightly older (1.1.0 vs 1.1.1) firmware version, so it may have been a firmware bug too...

Added: Ah, the plot thickens: with -a, exifTool reveals another SerialNumber in the makernotes, and this one is not malformed and may in fact be the correct one! I now have two samples for you (makernote, exif):
2181211531   -211375576
2331302326   -196366497
Looking at their hex representation I have not been able to see how to get from one to the other...
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Quote from: Hayo Baan on November 02, 2014, 11:44:20 AM
@Phil: I noticed that for the Nikon D70, the serial number is written as "NO= xxxxxxxx", perhaps it would be nice to strip off the NO= part?

Nikon writes a number of tags in string form.  In general, ExifTool only messes with the capitalization of these tags (to avoid ugliness in the output), but otherwise doesn't modify the strings.  In this case, "NO= " is part of the value stored.

QuoteAdded: Ah, the plot thickens: with -a, exifTool reveals another SerialNumber in the makernotes, and this one is not malformed and may in fact be the correct one! I now have two samples for you (makernote, exif):

I'll take a look at my samples tomorrow and see what I can determine about 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 ($).

TechnoPhil

Hello,
this is my discussion with Canon as i promised!

Question:

I discovered a bug in the EXIF data of the image, concerning the Lens Serial Number. DPP does to show the lens serial number of the lens used, but if you use other external programs, you are able to read it. This is an example of EXIF data shown by exiftool:

exiftool /temp/IMG_6184.CR2 | grep Serial

Internal Serial Number      : GD0040687
Serial Number                  : 023022003733
Lens Serial Number           : 0000204d8d

What is the "Internal Serial Number" ?
My actual lens serial number is 45842 ... so what is the number 0000204d8d shown?! Is it encrypted? If yes why? I think it could be useful in order to intercept for example a stolen equipment!

Answer from Canon:

You had several questions regarding serial numbers.  Unfortunately, the program you use does not come from Canon- it's third party software and isn't supported in any form by Canon.  So any of the questions you ask regarding that program, I am not able to answer. 

Please let us know if we can be of any further assistance.

;D


Phil Harvey

Quote from: TechnoPhil on November 03, 2014, 02:32:23 AM
I discovered a bug in the EXIF data of the image, concerning the Lens Serial Number. DPP does to show the lens serial number of the lens used, but if you use other external programs, you are able to read it. This is an example of EXIF data shown by exiftool:

You could try wording your question differently:

"My Canon camera writes a BodySerialNumber in the metadata of the images according to the EXIF specification, however this number does not match the serial number stamped on the body of my camera.  Is this expected?  If so, what is the meaning of the EXIF BodySerialNumber written by the camera?"

I think it is best not to mention exiftool, because I'm sure they are aware of it, and it most certainly causes them grief when it comes to customer support.

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

Phil Harvey

Quote from: Phil Harvey on November 02, 2014, 07:45:41 PM
Quote from: Hayo Baan on November 02, 2014, 11:44:20 AM
Added: Ah, the plot thickens: with -a, exifTool reveals another SerialNumber in the makernotes, and this one is not malformed and may in fact be the correct one! I now have two samples for you (makernote, exif):

I'll take a look at my samples tomorrow and see what I can determine about this.

For this camera (from imaging-resource.com):



I get this:

> exiftool ~/Desktop/E60DhSLI00100_NR_STD.JPG "-*serial*" -a -G1
[Canon]         Serial Number                   : 0370217391
[Canon]         Serial Number Format            : Format 2
[Canon]         Internal Serial Number          : WB0007188
[ExifIFD]       Serial Number                   : 0370217391
[ExifIFD]       Lens Serial Number              : 0000000000


The two serial numbers are correct.  Odd that they do not match for your 60D.  Definitely a firmware bug I would say, possibly in some signed vs. unsigned integer arithmetic, but I can't see how this would result in the numbers you mentioned.

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

Hayo Baan

Quote from: Phil Harvey on November 03, 2014, 07:20:31 AM
...
The two serial numbers are correct.  Odd that they do not match for your 60D.  Definitely a firmware bug I would say, possibly in some signed vs. unsigned integer arithmetic, but I can't see how this would result in the numbers you mentioned.

Yeah, I'm quite sure it was a firmware bug. Signed vs unsigned doesn't appear to be it, nor the one's complement or any other likely thing. Ah well, I think I'll assume the MakerNotes version was correct now :)

Thanks for looking into this!

@TechnoPhil, if your LensSerialNumber is also caused by  a firmware bug, perhaps you could see if a newer version is available? If there is one, they should be available from the Canon site.
Hayo Baan – Photography
Web: www.hayobaan.nl