Automatic perspective correction no longer works in recent dev builds?

I occasionally use the automatic perspective correction, especially on verticals and I like it a lot.
However, on more recent dev builds the feature apparently stopped working.
I’m running RT on win7, using the win64 builds made available by Gaaned, the most recent build I have where the auto correction still works is 5.8-3064-g690fab3d0 (2021-12-21).
I have also tried the most recent builds by Beep6581, same problem.

Press any of the “automatic” button, no effect on the image - in the history panel an item is added that says:
“Perspective - Camera
This was tested with a raw file on which auto perspective correction worked fine in earlier versions, without need to use control lines. Of course before each test, any pre-existing sidecar file was deleted to make sure I was starting with a clean slate.

When using control lines, same result. I can draw the control lines, when I’m done editing control lines nothing happens in the image and the corresponding 0,0,0 history item is added. In earlier versions where autocorrection still works, as soon as I’m done editing control lines the corrections are applied in the image.

1 Like

Hello @olandesevolante, welcome to the forum.

I notice the same thing as you. If I go to Transform-tab | Perspective and set Method = Camera-based, then neither appying control lines nor pressing automatic does anything. I also get “Perspective - Camera Rotation=0 Horizontal=0 Vertical=0” in history.

I use Linux Debian and build from git repo source. I have the latest git commit: 5.8-3093-g9b837e59b.

— Sorry, I’m actually not able to replicate this —

This options only works if there is data about the lens to be found in the lensfun database (or a supplied LCP file) and I inadvertently used a combo that doesn’t have a database entry.

Can either of you supply a RAW that this happens with?

Hello @Jade_NL ,

You can use this file example, Canon CR2, Canon 5D mk IV, EF 24-70 f/2.8.
0Y8A6797.CR2 (33.2 MB)

@olandesevolante / @KarlMagnusLarsson

Depending on what I use I can and cannot reproduce this issue (and it is not limited to the provided RAW):

  • Using the appimage 5.8-3067 and 5.8-3093 I can reproduce this behaviour: Auto, camera based perspective does not work
  • Using the latest self build version, 5.8-3093 I cannot reproduce this: Works as designed.

I’m getting the feeling that this might have something to do with the appimage. @Lawrence37 can you have a look at this?


Just for completeness: I do not see any messages in the terminal when using either of the 2 appimages and use the perspective section.

@Jade_NL Thank you for checking.

I do get this error from latest git commit source: 5.8-3093-g9b837e59b on Debian Linux.

I scratched my Rawtherapee build and recompiled and reinstalled. I still get this error. This time I also tried to use the ‘Perspective Correction’ icon.

  1. press Perspective Correction

  2. Draw two perspective lines

  3. press Perspective Correction again, to apply

After 1-2-3, nothing happens and I get “Perspective - Camera Rotation=0 Horizontal=0 Vertical=0” in history.

I will also try and rebuild older code and see if I can find a working commit. I have built
RT from source for years and this feature has worked for me, before.

In the win64 generic builds I’m using, the problem first appears in 5.8-3065 while 5.8-3064 works as designed.
The problem persists up to and including 5.8-3093 which is the latest available win64 build.

Regrettably I’m not well versed in the intricacies of building from source, so I can’t run any tests on self-built versions.


I’m also on Debian and just to make sure I also tried a fresh clone and build instead of a pull and build: No problems on my side of things.

Is your lensfun database up-to-date?


I’m presuming this is an image build issue and not a RawTherapee issue. If that is the case then I’m not surprised that this issue also shows up on the Windows (and probably Mac) build too.

We’ll have to wait until Lawrence has had a chance to look at it, he maintains the image building process if I’m not mistaken.

@Jade_NL , Thank you for the video. I was uncertain if this was related to how I executed the perspective correction procedure, but I follow the same steps in RT GUI as you showed.

Yes, my lensfun database is updated. The camera and the lens are old. I have a local lensfun database, for me as a user. I just did an update of lensfun db. There was a new version. It is now installed. There are no further lensfun db updates available.

$ lensfun-update-data
Info: root privileges needed for updating the system database.
Info: updating user DB in '/home/magnus/.local/share/lensfun/updates'
Reading …
Reading …
Info: No newer database was found for last installed Lensfun.

I also tried a fresh clone instead of git pull. Same thing. Perspective correction auto or control lines does not work for me. I can change perspective manually.

What is the root cause of error in my case? I can not understand what I have done to break this. If it works for you on Debian from source, it should, very likely at least, work for me as well. The perspective feature has worked before on my source build, but I am not a frequent user, so it was probably more than a year ago since previous use.

I am on Debian 11.


Only thing that I can come up with right now is this:

Have a look at your options file ($HOME/.config/RawTherapee/options) and look for the following entry


Does DBDirectory point to the correct directory?

@Jade_NL , Thank you for the advice. Yes it does point to correct lensfun db directory. I do regular updates. Lensfun works for me.

I get 5.8-3093-g9b837e59b as latest commit when I create a fresh clone.

You are on 5.8-3154-ga22716e9d (reading from the commit number top of frame). How do I get this code? I can not find commit a22716?

Yeah, I am :grin:

I’m actually on 3093, but I have 2 goodies installed on top of that that are not yet available in the master tree: #5769 and #6383. If you also merge those you end up with 3154 and ga22716e9d

BTW: I did the above testing without these added goodies, I just did not want to rebuild again just to make the video…

1 Like

I can confirm that at my end, the lensfun database works correctly on all tested builds.
There’s no path to the lensfun database in the options file, I suppose it looks for (and finds) the database files in the default location which on windows is

@Jade_NL , @olandesevolante , git dev source 5.8-3062-g4b8481f1c works for me, building from source on Debian 11.

This is way back: Thu Dec 16 07:50:31 2021

This is a very weak bisecting input. I am no way near to find the commit when it does not work for me, but it is a start. I just picked a random point in time, relatively long ago, since I knew I had a working build before.

@Jade_NL , @olandesevolante

git bisect resulted in this:

git bisect good
9c5ce0d9bb1df0e546041b1d8a8f2c63e94e5287 is the first bad commit
commit 9c5ce0d9bb1df0e546041b1d8a8f2c63e94e5287

Date:   Sat Jan 8 12:02:25 2022 -0800

    Fix focal len autofill after browser adjustments
    Don't update the camera-based perspective focal length and crop factor
    parameters when making other adjustments using the file browser or batch
    Closes #6402

 rtengine/ |  8 +++---
 rtengine/procparams.h   | 11 ++++++++
 rtgui/    | 69 +++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 70 insertions(+), 18 deletions(-)

Edit: git bisect is correct, the commit before works for me: 5.8-3064-g690fab3d0.

That makes sense, 5.8-3064 works for me, 5.8-3065 does not.

@olandesevolante, @Jade_NL I have filed an issue here: report.

I identified the problem and created a fix for it in PR #6488. If you have a GitHub account, you can download an automated build and check if the issue is resolved without side-effects.
Linux: Fix auto perspective correction not working sometimes · Beep6581/RawTherapee@2df2602 · GitHub
Windows: Fix auto perspective correction not working sometimes · Beep6581/RawTherapee@2df2602 · GitHub


That’s quick! :slight_smile:
Issue appears resolved, haven’t noticed any obvious side effects.


Can you push this fix to the automated release Builds, so I can unzip and run the executable from the extracted zip file without losing my Current settings?

The link you posted for win64 loads a fresh copy of RT.