Update LensType and LensID fields

Started by niels123, June 22, 2016, 10:02:26 AM

Previous topic - Next topic

niels123

My friend and I shoot with special microscope lenses attached to normal camera lenses. I managed to update the Lens and LensModel fields with a new "Canon ... + microscope objective ..." string and it works perfectly in lightroom.

My friend however, uses Aperture and if I send him and updated CR2, he still sees the old info, probably from LensType / LensID.
1) Which fields does Aperture read to determine the lens? Is there a way to tell Aperture that a "Canon 200mm f/2.8 + Nikon 4x NA 0.10" is attached and that this is displayed in the "Lens" field inside Aperture?

2) I tried to modify the LensType. It doesn't get updated and stays unchanged, but the Lens and LensModel fields change nicely. What goes wrong here? What I try, as an example, is:

"C:\ExifTool\exiftool.exe" -LensType="747" -m -overwrite_original_in_place -P "T:\test\5D3_1097.CR2"


Many thanks!
Niels

Phil Harvey

Quote from: niels123 on June 22, 2016, 10:02:26 AM
1) Which fields does Aperture read to determine the lens?

I can't say.

Quote2) I tried to modify the LensType. It doesn't get updated and stays unchanged, but the Lens and LensModel fields change nicely. What goes wrong here?

I think this is FAQ 6.  Try adding -n to your command, or writing -lenstype# instead of -lenstype.

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

niels123

Thanks it works!

Is there a way to get other data in there to have LensType to show a custom string which is not in the LenType values table?

How about a Nikon lens with an adapter attached to a Canon Body? Is there a way to put a (third party) Nikon lens in a Canon raw file as LensType?
For example, The Zeiss Otus 55mm f/1.4ZE for Canon has LensType 198.1
The Nikon LensID in a NEF file would be '00 54 53 53 0C 0C 00 00'

One last question: how does it work with third party lenses in CR2 files? 198.1 is the LensType for Otus55 ZE, but if you manually put that in a raw file ExifTool says "Canon 50mm f/1.4 or Zeiss lens", which is exactly the same text which is displayed when you put "198" as LensType. If I open CR2 files taken with a Zeiss ZE lens attached LR nicely shows exactly which Zeiss lens was used, so I'm a bit confused here.

Phil Harvey

Quote from: niels123 on June 22, 2016, 10:46:15 AM
Is there a way to get other data in there to have LensType to show a custom string which is not in the LenType values table?

Is there a way to put a (third party) Nikon lens in a Canon raw file as LensType?

All that is written is a number.  ExifTool has a lookup table that converts this to a lens model.  You can write any number you want, but ExifTool will only recognized the ones listed here for Canon cameras.

QuoteOne last question: how does it work with third party lenses in CR2 files? 198.1 is the LensType for Otus55 ZE, but if you manually put that in a raw file ExifTool says "Canon 50mm f/1.4 or Zeiss lens", which is exactly the same text which is displayed when you put "198" as LensType. If I open CR2 files taken with a Zeiss ZE lens attached LR nicely shows exactly which Zeiss lens was used, so I'm a bit confused here.

You're talking about LensID, which is a Composite tag based on LensType and other things like FocalLength and MaxAperture.  Using this other information ExifTool attempts to determine which lens was actually used in cases where the LensType number is used by multiple lens models.

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

niels123

So effectively, there is no LensType number for an original Nikon lens if attached to a Canon body? Or a Sony lens attached to a Canon mirrorless?

Phil Harvey

I can't say.  It depends on the adapter.  Smart adapters can generate fake LensType numbers.  I don't think I've seen this yet for a Canon adapter, but it could happen.  I've seen this for other makes.

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

niels123

A LensType number can also be entered manually in post. I have one adapter for Nikon lenses on a Canon body, which is a mechanical-only coupling from Novoflex. I suppose that it is not possible to manually enter a LensType number in a CR2 file which is identified as a Nikon lens?

Phil Harvey

You can write any number you want to LensType using 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 ($).

niels123

#8
For technical reasons, I'd like to use my MP-E65mm Macro Photo as such that there is no electronic connection between my camera and the lens. In post, I want to add all lens info to the CR2 files. Most tags work fine, but one tag gives some problems. The stored InternalSerialNumber in a CR2 when the MP-E is connected is "VC0863533". If I try to add it to a 'blank CR2 using:

-InternalSerialNumber="VC0863533"

I end up with


InternalSerialNumber = VC0863


Why are the last three digits removed (or rather, not added)?

Phil Harvey

I tried this with a CR2 from an EOS 80D and it doesn't show this problem.  What model are you using?

> exiftool a.cr2 -internalserialnumber=VC0863533
    1 image files updated
> exiftool a.cr2 -internalserialnumber -model
Internal Serial Number          : VC0863533
Camera Model Name               : Canon EOS 80D


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

niels123

I have multipe bodies, including 700D, 5D3, 6D and 7D2.

I just checked: For 7D2, T2i, T3i, T4i, T5i, T6i and 6D  it does work.
It seems the only camera for which it doesn't work is the 5D III. Would you mind to check if I upload a raw file and place the link here?

Phil Harvey

Ah, right.  For the 5DmkIII the InternalSerialNumber is part of a binary data block (called SerialInfo by ExifTool).  This data block is only large enough for a 6-character 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 ($).

niels123

I see :)
What is the difference between InternalSerialNumber and LensSerialNumberr?

How is the InternalSerialNumber stored in CR2's from the 5Ds(r)?

Phil Harvey

InternalSerialNumber is presumably related to part of the camera.  I don't know what part, but not the lens I think.

In most models this is a simple string.

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

niels123

I see. Google provided me with a 5DS , 1DX and 1DXmkII sample CR2 file and I checked. 1DX and 1DXII work fine, but 5DS InternalSerialNumber is also limited to six digits.