Darktable: lens correction preset does not apply automatic scale

I would like to make darktable auto apply lens correction to new images.

I created a preset and checked “auto apply this preset to matching images”.

It correctly applies the module to new images, and correctly adapt focal length, aperture and distance for the new image.
Unfortunately, it applies the scale parameter of the original image from which I created the preset, and I have to manually click on auto scale button.

Is this a desired behavior, or should I create an issue about this?

Without automatic scaling, it is better to manually enable lens correction for each image instead of manually clicking on auto scale in the auto applied module, but it would be far better to have the module auto applied with auto scaling.

1 Like

The only preset you should use is to turn on the module. Otherwise you’re just copying settings around from the image you used to create the preset. This is the intended functionality at the moment.

3 Likes

You can define a specific preset for every lens you use btw.

2 Likes

@Luca_Fornasari I am not addressing your original question which has already been answered, but I personally would only recommend applying the lens correction to images where it is clearly needed rather than blindly to every image. My logic for this includes the fact that distortion correction will crop away part of the image. I use lens correction a lot when straight lines have become curved by lens distortion but this is not apparent in every image I shoot. Just a personal opinion that I am expressing. Good luck with DT. It is a great program made by a fantastic group of developers. Welcome to the forum.

2 Likes

Try this preset; it does what Mica recommended, this is what I use. You can import it via preferences → presets.

lens_lens correction on.dtpreset (1011 Bytes)

1 Like

Thank you all! I found the best way for me is to use a style, with Lens Correction applied with “reset”.

Sorry to bump up this thread, but one preset per lens is almost ok for fixed focal lenses (except aperture ) , but for zoom lenses ?
IMHO presets or styles aren’t usable for lensfun correction
Nonetheless, it’s ok for “embedded metadata”.
@Terry : ok with your opinion. Lens correction isn’t mandatory for all pictures, especially “distortion”, but vignetting correction could be useful

1 Like

If you’re not getting lensfun to match the names of your lenses, you need to make a config file for exiv2 to match the lens name in your raw file metadata to what lensfun expects: User's portal · darktable-org/darktable Wiki · GitHub

Before my new sigma 16-300mm lens was added to the lens fun database I created presets for vignetting at certain focal lengths to fix obvious vignetting in blue skies. I was disappointed I couldn’t do manual distortion corrections as I could see this as an improvement for DT, especially for unsupported lenses.

I simply turned lens correction on, and, without performing any adjustments, created an auto-applied preset lens correction on. It works on both of my cameras, using lensfun, taking focal length properly into account.