Lens name for legacy lenses?

Hi there,

After Adobe’s announcement of “subscription only” for Lightroom I’m considering switching back to RawTherapee (which I had used as version 2 a long time ago).

I only use legacy glass on my Sony NEX-6 which does not communicate with the camera. So I manually write the lens name into the “LensModel” tag of every raw file using exiftool.

This works fine for LR, but in RT, the lens is shown as “unknown”.

Is there a way to use an arbitrary text string as lens name in RT? Not only for displaying, but also for using it with filtering, flat field correction, lens profiles etc.?

In case this makes a difference, I am using RT 5.0 (I don’t yet have a 64bit machine) on Windows 7.

Thanks for any help!

Hey

Find your lens in this list and the one that follows it:
https://github.com/Beep6581/RawTherapee/blob/dev/rtexif/sonyminoltaattribs.cc#L547

Then backup your photos and run:

exiftool -P -overwrite_original_in_place -LensInfo='Sony E 16-70mm f/4 ZA OSS' photo.raw

No.

Hi,

Thanks for the quick response.

My lenses are not in these tables. Nor does exiftool accept the lens names as arguments for the LensInfo tag (because the lenses are not in the corresponding exiftool tables either, I guess).

No other possibility?

Best regards,
Bezier

Yes, no problem with EXIFTOOL. I do it all the time. :wink:

E.g.:
exiftool -P -progress -r -overwrite_original -LensMake=“[any text]” -LensModel=“[any text]” -FNumber=“[any value]” -LensSpec=“[anything you want]” filename.ext

FYI:
https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html

Hi PanoMeister,

Maybe a misunderstanding. I’m fine with putting into the raw file any values I like, using exiftool. I’ve done this for years.

However, no matter what and where I write, RT just shows an “unknown” lens. Apparently, if I understand Morgan correctly, because my lenses are not in RT’s lens tables.

Regards
Bezier

My lenses aren’t in those tables either (old manual focus lenses with no electronics communication with the camera). But I haven’t ever been bothered enough to do anything about it. So I have a question: if @Bezier is willing to compile RT from source, could he add his lenses to the table before compiling RT, following the format of the other lenses in the table, and then would RT be able to display the lens?

@Bezier please upload a sample file to filebin.net and post the link here. I will have a look then.

Here is a file:
https://filebin.net/qy8jaitc4p2behbv/DSC04417.ARW

I set the LensModel, FocalLength, and FocalLengthIn35mmFormat tags using exiftool. LensModel is the only one I’m interested in here. Of course, I could also write any other tag if this provided a solution.

More generally, couldn’t it be an idea that RT, if it doesn’t find a lens using the current algorithm, looks into the LensModel tag? Naturally, I don’t know if this were compatible with the current implementation.

Thanks & best regards
Bezier

Coming back to this issue, I found a rather, hmm, mean workaround.

I select a lens from the Sony -lenstype tag list and write the corresponding number to the -lenstype tag using exiftool. Then, I open rawtherapee.exe in a hex editor and overwrite the original lens name with my own.

Works, but of course not very nice.

If I were to compile the RT code myself, I guess I could instead modify the appropriate table in the rtexif section, couldn’t I?

Still, I think it would be great if there were a possibility to have the lens name read as a text string from the -lensmodel tag.

By the way, you guys are doing a great job on RT!

Best regards,
Bezier

1 Like

Hi there,

still thinking about this issue (since the ability to recognize arbitrary lens names is a prerequisite for using RT for me).

I have a proposal to make:

In file “imagedata.cc”:

In line 276, there is an if statement <if (lens == “Unknown”) …>
Couldn’t you close this if statement after line 456, and start a new <if(lens == “Unknown”)> right after, encompassing the three statements extracting the lens name from lens info tags (exactly what I’d want)?

If I’m not completely mistaken, if a lens name is found in the mnote, or if there is no mnote at all, the functionality would be the same. But if there IS mnote but NO lens name can be extracted, it would be read from one of the “lens” tags. Unlike today, where it remains “Unknown”.

Couldn’t this work?

Best regards,
Bezier

I thought it might be useful to mention how Nikon DLSR’s handle legacy lenses.
I have a D7000, which has options for what it refers to as “non CPU lenses” to store the focal range for four such lenses. If the lens is Nikon lens the camera manually reads the zoom level via a small lever in the camera fitting.

When loading the raw file RT reads the exif data and shows, for example “Nikon D7000 + MF 200.0mm f/2.8” I guess the MF indicates Multifocal - that is a Zoom lens.

In the exif we have

Lens Data 
             ....
      Lens = Unknown $FL$mm f/2.8

So we have a similar problem to those whose cameras report lens “unknown”.

Being a Nikon user and for that reason having coded that special part of RT lens information for Nikon cameras which allow to set the focal length and the max aperture of a MF (manual focus) lens in camera menu, I can assure, that

  1. MF means Manual Focus
  2. there is no information about the used focal length of a manual focus (means non-chipped) zoom lens in exif
  3. for non zoom AI and Ais Nikon lenses (primes), when used on the pro and semi pro Nikon cameras (starting with D200, D700 and so on) the used aperture is recorded correctly if the lens is correctly set in the camera menu.
1 Like

Example:
I used the Ais 85mm/1.4 on my D700 and selected it in camera (for semi pro and pro Nikons you can preset a number of MF lenses in camera menu and then quick select them using a dial and a function key)

The info dialog shows the lens I used (MF 85mm f/1.4 max aperture) and also the aperture I used (f/4.0)

@heckflosse
That was already proposed above.
When lens model decoding fails for some reason( legacy lens, manual lens, lens not recognised by camera maker…) giving unknown name, should it be possible to fall back to simply reading

0xa433 	LensMake 	string 	ExifIFD 	 
0xa434 	LensModel 	string 	ExifIFD 

and concatenating these two fields to provide lens name.

After that it wil be up to user to fill these fields and include lens corrections of their lens inside lensfun.

When a lens name is missing, you can set its name manually using ExifTool or Exiv2, and RawTherapee 5.6 will use your manually-set name in the metadata filters and to load the correct Lensfun profile. Handled in issue #5157 Lens name from lens tag if lens not in Lensfun database · Issue #5157 · Beep6581/RawTherapee · GitHub

I do that. However, my lenses normally are not in the LensFun database. But I need the lens name in RawTherapee so I can filter for it and apply appropriate profiles myself.

Best regards,
Bezier