Tag-setting workflow for old manual lenses?

Started by ecl10, April 06, 2016, 10:18:55 AM

Previous topic - Next topic

ecl10

Hi, all.  exiftool is awesome!  What would we do without it?  And now my questions. . .

I'm using exiftool to update image file metadata when using lenses that don't provide metadata (i.e., the camera---in my case a Sony a6000/ILCE-6000---thinks that no lens is attached). I have two questions concerning my workflow. . .

(i) Are the following a sensible set of tags to set?  Assuming I'm transforming a .JPG or .ARW file produced by a Sony a6000/ILCE-6000.

$ exiftool \
-LensMake=Ricoh \
-LensModel="Rikenon P 50mm f/2" \
-LensType3="Unknown E-mount lens or other lens" \
-LensSpec="50mm f/2" \
-LensMount2=Unknown \
-LensMount=Unknown \
-LensFormat=Full-frame \
-LensInfo="50 50 2 2" \
-MaxApertureValue=2.0 \
-FocalLength="50.0 mm" \
-MinFocalLength="50.0 mm" \
-MaxFocalLength="50.0 mm" \
-FocalLengthIn35mmFormat="75 mm" \
-LensSpecFeatures="" \
pic.jpg


The tags look reasonable after this and the tags displayed by Lightroom look good. Do any experts suggest other tags? Or suggest skipping any tags?

(ii) Setting the above tags results in the composite LensID being incorrect. I should probably just forget it, but I can't help but wonder whether there's a way via .ExifTool_config to either make the LensID something like "unknown" or actually make it correct. Naturally, the Ricoh lens, above, is not known to exiftool because it's so old it doesn't have tags associated with it.  Similarly, the "Rokinon 12mm f/2 NCS CS" doesn't provide exif data, so exiftool doesn't know about it.  After I set the tags for the Ricoh lens (note that LensType# defaults to 65535), here's what exiftool tells me. . .

$ exiftool -G -LensID pic10.jpg
[Composite]     Lens ID                         : Zeiss Loxia 50mm F2


It appears the code in Exif.pm:PrintLensID() prints to first 50mm F2 lens it finds with LensType equal to 65535. Even if I tweak Minolta.pm (this is where the Zeiss lens comes from; it's referenced by Sony.pm) and add my own lens. This code picks the first one, so I don't even have a chance to use @Image::ExifTool::UserDefined::Lenses in my .ExifTool_config to make the lens I defined preferred.

Again, I should probably just forget about LensID being correct (i.e., "unknown" or "Ricoh Rikenon P 50mm f/2" in this case). But it sure would be great exiftool where smart enough not to guess Zeiss when, e.g., the LensMake is completely wrong ("Ricoh" != "Zeiss"). Or it would be nice if .ExifTool_config were sufficiently flexible to allow me to define my own lens.

Any advice?

Thanks for the wonderful tool!  E.

Phil Harvey

Yes, the Sony lens logic is a bit tricky.  What are the values of all of these tags from an original image taken with the Rikenon lens?

It would be nice if support for this lens could be added 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 ($).

ecl10

Yes, it would be great if exiftool "knew" about these lenses. But there is no lens-related info in the exif data, because there is no electrical contact between the camera and the lens.  The two lenses I'm interested in are (i) "Ricoh Rikenon P 50mm f/2" (maker: Ricoh; this is a k-mount lens, so I'm using a k-mount-to-e-mount adapter to use on the a6000) and (ii) "Rokinon 12mm f/2 NCS CS" (maker: Rokinon; the similarity in name with Rikenon is coincidental).

FYI, here's what an image from the Sony a6000/ILCE-6000 looks like when it thinks no lens is attached (i.e., when either of the above lenses is attached; although I should admit that I haven't used the Rokinon lens yet; it's in the mail; but it also has no electrical contacts).

$ exiftool -G DSC04444.JPG | egrep -i lens\|focal
[EXIF]          Focal Length                    : 0.0 mm
[EXIF]          Focal Length In 35mm Format     : 0 mm
[EXIF]          Lens Model                      : ----
[MakerNotes]    Lens Type                       : E-Mount, T-Mount, Other Lens or no lens
[MakerNotes]    Lens Spec                       : Unknown (00 0 0 0 0 00)
[MakerNotes]    Focal Plane AF Points Used      : (none)
[MakerNotes]    Lens Zoom Position              : 0%
[MakerNotes]    Lens Mount 2                    : Unknown
[MakerNotes]    Lens E-mount Version            : 1.20
[MakerNotes]    Lens Firmware Version           : Ver.02
[MakerNotes]    Min Focal Length                : 0.0 mm
[MakerNotes]    Lens Mount                      : Unknown
[MakerNotes]    Lens Format                     : Unknown
[MakerNotes]    Lens Spec Features              :
[Composite]     Lens ID                         : ----
[Composite]     Focal Length                    : 0.0 mm


Thanks!  E.

Phil Harvey

Since the lens isn't chipped, I don't think it makes sense to write the Makernote information as if the lens was chipped.

If you take the original file and just write EXIF:LensMake and EXIF:LensModel, then ExifTool returns the correct lens name.  You can also write EXIF:FocalLength if you want, but when you start writing other MakerNote tags then ExifTool starts to think that it knows better than EXIF and then chooses the Zeiss lens instead.

So what about just writing the standard EXIF tags?

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

ecl10

Hi, Phil. It certainly makes sense to skip all the MakerNotes stuff and only populate the standard EXIF tags.  You suggest EXIF:LensMake, EXIF:LensModel, and EXIF:FocalLength.  It's tempting to also set EXIF:FocalLengthIn35mmFormat and EXIF:LensInfo. If I do this, exiftool uses EXIF:LensModel for Composite:LensID (and Composite:FocalLength is correct, too).  Yay!

But them I'm tempted to set EXIF:MaxApertureValue, too.  If I do this, exiftool guesses that I've got a "Zeiss Loxia 50mm F2" again. It looks like it's not quite as simple as not setting the MakerNotes. It's not the end of the world to skip MaxApertureValue.

Thanks!  E.

$ exiftool -G pic12.jpg | egrep -i lens\|focal\|aper
[EXIF]          Exposure Program                : Aperture-priority AE
[EXIF]          Max Aperture Value              : 1.0
[EXIF]          Focal Length                    : 0.0 mm
[EXIF]          Focal Length In 35mm Format     : 0 mm
[EXIF]          Lens Model                      : ----
[MakerNotes]    Lens Type                       : E-Mount, T-Mount, Other Lens or no lens
[MakerNotes]    Lens Spec                       : Unknown (00 0 0 0 0 00)
[MakerNotes]    Focal Plane AF Points Used      : (none)
[MakerNotes]    Lens Zoom Position              : 0%
[MakerNotes]    Sony Max Aperture Value         : 1.0
[MakerNotes]    Lens Mount 2                    : Unknown
[MakerNotes]    Lens E-mount Version            : 1.20
[MakerNotes]    Lens Firmware Version           : Ver.02
[MakerNotes]    Min Focal Length                : 0.0 mm
[MakerNotes]    Lens Mount                      : Unknown
[MakerNotes]    Lens Format                     : Unknown
[MakerNotes]    Lens Spec Features              :
[Composite]     Lens ID                         : ----
[Composite]     Focal Length                    : 0.0 mm

$ exiftool -EXIF:LensMake=Ricoh -EXIF:LensModel="Rikenon P 50mm f/2" -EXIF:FocalLength="50 mm" -EXIF:FocalLengthIn35mmFormat="75 mm" -EXIF:LensInfo="50 50 2 2" pic12.jpg
    1 image files updated

$ exiftool -G pic12.jpg | egrep -i lens\|focal\|aper
[EXIF]          Exposure Program                : Aperture-priority AE
[EXIF]          Max Aperture Value              : 1.0
[EXIF]          Focal Length                    : 50.0 mm
[EXIF]          Focal Length In 35mm Format     : 75 mm
[EXIF]          Lens Info                       : 50mm f/2
[EXIF]          Lens Make                       : Ricoh
[EXIF]          Lens Model                      : Rikenon P 50mm f/2
[MakerNotes]    Lens Type                       : E-Mount, T-Mount, Other Lens or no lens
[MakerNotes]    Lens Spec                       : Unknown (00 0 0 0 0 00)
[MakerNotes]    Focal Plane AF Points Used      : (none)
[MakerNotes]    Lens Zoom Position              : 0%
[MakerNotes]    Sony Max Aperture Value         : 1.0
[MakerNotes]    Lens Mount 2                    : Unknown
[MakerNotes]    Lens E-mount Version            : 1.20
[MakerNotes]    Lens Firmware Version           : Ver.02
[MakerNotes]    Min Focal Length                : 0.0 mm
[MakerNotes]    Lens Mount                      : Unknown
[MakerNotes]    Lens Format                     : Unknown
[MakerNotes]    Lens Spec Features              :
[Composite]     Lens ID                         : Rikenon P 50mm f/2         <-------------------- looking good!
[Composite]     Focal Length                    : 50.0 mm (35 mm equivalent: 75.0 mm)

$ exiftool -EXIF:MaxApertureValue=2.0 pic12.jpg
    1 image files updated

$ exiftool -G pic12.jpg | egrep -i lens\|focal\|aper
[EXIF]          Exposure Program                : Aperture-priority AE
[EXIF]          Max Aperture Value              : 2.0
[EXIF]          Focal Length                    : 50.0 mm
[EXIF]          Focal Length In 35mm Format     : 75 mm
[EXIF]          Lens Info                       : 50mm f/2
[EXIF]          Lens Make                       : Ricoh
[EXIF]          Lens Model                      : Rikenon P 50mm f/2
[MakerNotes]    Lens Type                       : E-Mount, T-Mount, Other Lens or no lens
[MakerNotes]    Lens Spec                       : Unknown (00 0 0 0 0 00)
[MakerNotes]    Focal Plane AF Points Used      : (none)
[MakerNotes]    Lens Zoom Position              : 0%
[MakerNotes]    Sony Max Aperture Value         : 1.0
[MakerNotes]    Lens Mount 2                    : Unknown
[MakerNotes]    Lens E-mount Version            : 1.20
[MakerNotes]    Lens Firmware Version           : Ver.02
[MakerNotes]    Min Focal Length                : 0.0 mm
[MakerNotes]    Lens Mount                      : Unknown
[MakerNotes]    Lens Format                     : Unknown
[MakerNotes]    Lens Spec Features              :
[Composite]     Lens ID                         : Zeiss Loxia 50mm F2                <------------------- oops!
[Composite]     Focal Length                    : 50.0 mm (35 mm equivalent: 75.0 mm)

Phil Harvey

Sounds like a reasonable compromise.  Too bad about MaxApertureValue, but I can't see an easy way around 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 ($).

ecl10

Thanks for all the help, Phil.  And thanks for the excellent exiftool!  E.