Bug 414484 - Cannot use Rawtherapee or Darktable for raw image import on Windows
Summary: Cannot use Rawtherapee or Darktable for raw image import on Windows
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-RawImport-Rawtherapee (show other bugs)
Version: 6.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-25 08:53 UTC by tlteebken-reg
Modified: 2022-01-26 04:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments
Image rendered in RT after loading from Digikam (169.92 KB, image/jpeg)
2019-11-28 20:18 UTC, tlteebken-reg
Details
Image rendered in Image Editor after returning from RT (223.42 KB, image/jpeg)
2019-11-28 20:19 UTC, tlteebken-reg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tlteebken-reg 2019-11-25 08:53:08 UTC
SUMMARY
On Windows 10 and Digikam 6.4, cannot set Rawtherapee or Darktable as the default raw image import tool. 

STEPS TO REPRODUCE
1. Click Settings > Configure Digikam > Image editor > Raw behavior, and select "Raw import using Rawtherapee" or "Raw import using Darktable."  
2. Double-click any .Dng raw file in my Digikam database to edit it. 

OBSERVED RESULT
The image editor opens up empty and never loads the image. 

EXPECTED RESULT
The selected .dng file in Digikam should be opened up in whatever Raw handling application I specified in Settings (in this case, Rawtherapee 5.7).  After editing the DNG in Rawtherapee, when you close the Rawtherapee window the edited DNG file should automatically be opened in the Digikam image editor.  This workflow is exactly how both Rawtherappe and Darktable work with Gimp, and they should be working this way with Digikam.  

SOFTWARE/OS VERSIONS
Windows: 10 Enterprise (latest Nov 2019 update, Build 1909)
Rawtherapee v 5.7 (latest Windows version)
Darktable v 2.6.2 (latest Windows version)

ADDITIONAL INFORMATION
If I use the default "libraw" raw image handler in Digikam, it works fine.  It appears the new Digikam 6.4 feature of enabling external raw image handlers such as Rawtherapee and Darktable is not working on Windows.
Comment 1 Maik Qualmann 2019-11-25 08:59:28 UTC

*** This bug has been marked as a duplicate of bug 414340 ***
Comment 2 Maik Qualmann 2019-11-25 09:01:45 UTC
You can find here a current beta of digiKam-7.0.0 for testing:

https://files.kde.org/digikam/

Maik
Comment 3 tlteebken-reg 2019-11-25 09:16:04 UTC
A quick update to my bug: made some progress, but import using Rawtherapee still fails.

1. If I set the exact path of the Rawtherapee executable in my PATH environment variable on Windows (D:\Program Files\Rawtherapee\5.7), Digikam does indeed open up a clicked .dng file in Rawtherapee. Before, I did not have the "5.7" portion of the RT executable path included in my PATH variable. 

2. However, import of the raw image still fails.  After I load an image in RT this way and edit it, then close RT, I get this error in Digikam image editor:

---------------------------
digikam
---------------------------
Error to import RAW image with RawTherapee
Close this dialog to load RAW image with native import tool
---------------------------
&OK   
---------------------------
Comment 4 Maik Qualmann 2019-11-25 10:17:57 UTC
But you have not tested digiKam-7.0.0 beta?

Maik
Comment 5 tlteebken-reg 2019-11-25 16:06:04 UTC
Running the Digikam v7 beta actually makes it worse--it does not load RT or DT at all, even with fully specified executable path in PATH.  I tried it both ways in PATH:  the top-level app folder, or the specific version-level folder. In both cases, Digikam does not even load the clicked .DNG image in the selected raw editor. 

Thoughts on what I should try?
Comment 6 caulier.gilles 2019-11-25 16:35:47 UTC
I'm not yet sure if i re-buid windows bundle version 7.0.0 with last changes from Maik.

I start compilation now. Installer will be available in 2 hour...

Gilles Caulier
Comment 7 Maik Qualmann 2019-11-25 16:44:06 UTC
We use another function in digiKam-7.0.0 to find the EXE file. The path variable should still be read. However, we give possible paths, it on the way. With you however your programs are on drive D. I test it again tonight. The current bundle should contain all changes.

Maik
Comment 8 Maik Qualmann 2019-11-25 16:54:57 UTC
Ok, if we pass possible paths, the path variable is ignored. I change it again, Gimp also needs the path variable under Windows.

Maik
Comment 9 Maik Qualmann 2019-11-25 17:36:43 UTC
Gilles, would be nice if you would recreate the bundles with this change.

https://invent.kde.org/kde/digikam/commit/b50ee49d2455c936f02178d59389669e0796e506

Maik
Comment 10 caulier.gilles 2019-11-26 05:29:57 UTC
I will restart Windows bundle build this morning...

Gilles
Comment 11 tlteebken-reg 2019-11-26 22:56:08 UTC
Hi, your latest change which I tested in today's Win x64 build improved things a bit.  When I click a .DNG file in Digikam, it now loads the image in RT, and round-trips it back to the Digikam image editor.  Note that this works *only* if I specify the full path to the RT executable (D:\Program Files\Rawtherapee\5.7) in PATH variable.  Just adding the parent RT app folder does not work.

A couple of additional observations, from some quick testing:
1.  Darktable does not work at all.  I have latest version installed on my system, and added to PATH, but it will not even open a .DNG image in DT. 

2.  The round-tripped .DNG file is rendered incorrectly in Digikam's image editor.  It looks ok originally in Digikam, and in RT when it opens.  But even if I simply close RT without any editing changes, the image is opened in the image editor with changes that are blatant and incorrect.  

Thanks!
Comment 12 Maik Qualmann 2019-11-27 07:47:07 UTC
That they have to give the full path is normal. Gimp requires the same setting for the path. I can not tell the difference between a DND in RawTherapee and later in the Image Editor of digiKam. Maybe make a screenshot.

Maik
Comment 13 Maik Qualmann 2019-11-27 08:28:07 UTC
Also Darktable works here without problems. One more note to the path, in a standard Windows installation (programs installed on C), setting the PATH variable is not essential.

Maik
Comment 14 tlteebken-reg 2019-11-27 16:30:05 UTC
Darktable 2.6.2 (latest on Win x64) does not work here.  And, regarding Gimp, I've never had to add the path of RT and DT to PATH variable for GIMP to recognize them.  It works automatically upon installation with Gimp 2.10.14.
Comment 15 tlteebken-reg 2019-11-27 16:30:26 UTC
Darktable 2.6.2 (latest on Win x64) does not work here.  And, regarding Gimp, I've never had to add the path of RT and DT to PATH variable for GIMP to recognize them.  It works automatically upon installation with Gimp 2.10.14.
Comment 16 Maik Qualmann 2019-11-28 19:10:52 UTC
Git commit 45d9a2fec09dcbad546ecd5d371b65be73931377 by Maik Qualmann.
Committed on 28/11/2019 at 19:10.
Pushed by mqualmann into branch 'master'.

try reading the Windows registry to get paths

M  +8    -1    core/dplugins/rawimport/darktable/rawimportdarktableplugin.cpp
M  +8    -4    core/dplugins/rawimport/rawtherapee/rawimportrawtherapeeplugin.cpp

https://invent.kde.org/kde/digikam/commit/45d9a2fec09dcbad546ecd5d371b65be73931377
Comment 17 tlteebken-reg 2019-11-28 20:18:18 UTC
Created attachment 124169 [details]
Image rendered in RT after loading from Digikam
Comment 18 tlteebken-reg 2019-11-28 20:19:05 UTC
Created attachment 124170 [details]
Image rendered in Image Editor after returning from RT

No edits were made in RT
Comment 19 tlteebken-reg 2019-11-28 20:20:55 UTC
Ok so I installed latest bits:  no changes with regard to the issue.  RT still works, DT will not even load.  

Next thing:  the pictures that are round-tripped from RT are still rendering badly in Image Editor.  They have artifacts or dark spots.  This is true with roughly 3/4 of the images I tried.  I've attached before and after pics, "before" is how it looks loaded in RT, "after" is returned to Image Editor.  I circled in red the problem areas.  This is just a representative example.
Comment 20 Maik Qualmann 2019-11-28 20:45:11 UTC
The modification of Comment 16 is not yet current bundle included, until tomorrow when Gilles builds a new one.

Maik
Comment 21 Maik Qualmann 2019-11-28 20:47:27 UTC
Ok, the image is displayed perfectly in digiKam, no bug ((:-)) You have the display of overexposure enabled in the image editor, bottom right, the 2 icons.

Maik
Comment 22 tlteebken-reg 2019-11-29 06:54:09 UTC
Ah you're right on the exposure control, my bad, sorry.  I'm new-ish to Digikam UI.
Comment 23 caulier.gilles 2019-11-29 06:56:10 UTC
Windows bundles are under compilation and will be published in 1 hour at usual place

Gilles Caulier
Comment 24 tlteebken-reg 2019-11-29 17:52:34 UTC
Installed latest bits, still no success with DT.

This may be worth noting:  I wonder if your test cases are the same as my use case on Win x64. 
* Latest versions of everything (Win x64, Digikam, RT, DT)
* And...note that I have BOTH RT and DT installed same time. I've noticed that in Gimp, you can sort of 'pin' which one is currently the default in the plugin settings, even though both show up there.  And yes, I tried to 'pin' DT as the default, that did work in Gimp but had no impact on Digikam.

For my part, I'm good to go.  I actually slightly prefer RT over DT anyway, and since it works, I'll go with it.

Thanks for the updates and responses.
Comment 25 tlteebken-reg 2019-11-29 17:56:58 UTC
Also I forgot to add:  thank you for your efforts on Digikam.  I've been gradually converting most of my personal software to FOSS and with the latest improvements in Gimp (incl 32-bit support), RT, and Digikam, it's now possible to have pretty awesome graphics software functionality, without needing to spend for Adobe PS or other expensive subscriptions.  One of the big things I had not found up to this point was a good digital assets management (DAM) software app that was FOSS.  Digikam is really the ticket.  I especially love it's awesome metadata support.  That is one aspect of Digikam, and there are others, that are actually BETTER than any commercial software package I have tried.  

Thanks for the work.
Comment 26 Maik Qualmann 2019-11-29 18:16:16 UTC
Did you remove the Darktable PATH variable again? This will be used at the moment, if it exists. Works here with the reading of the Windows registry without problems.

Maik
Comment 27 tlteebken-reg 2019-11-29 18:19:42 UTC
Success!  That did the trick--I had to remove the darktable path from PATH.  BTW to test, I also removed the RT path as well.  Now it appears the fix is working and figuring out both RAW editor locations from Win registry. 

Good job.
Comment 28 Maik Qualmann 2019-11-29 18:31:42 UTC
Thanks for the feedback. We will remove the support of the PATH variable.

Maik
Comment 29 Maik Qualmann 2019-11-29 19:38:02 UTC
Git commit f55566446b77050dcbcf0e97646f7c0a72255238 by Maik Qualmann.
Committed on 29/11/2019 at 19:32.
Pushed by mqualmann into branch 'master'.

reading Windows registry to get program paths
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +8    -16   core/dplugins/rawimport/darktable/rawimportdarktableplugin.cpp
M  +8    -16   core/dplugins/rawimport/rawtherapee/rawimportrawtherapeeplugin.cpp

https://invent.kde.org/kde/digikam/commit/f55566446b77050dcbcf0e97646f7c0a72255238
Comment 30 tlteebken-reg 2019-12-11 19:39:30 UTC
Hi, this was working for me on earlier builds of DK 7.0 beta.  On today's build, it has regressed and again when I set Darktable as the default import tool for RAW files, it fails and produces an error as in the original bug report.
Comment 31 tlteebken-reg 2019-12-11 19:43:36 UTC
I have it working again--but I had to add the path to darktable back to my PATH env var.

I thought the update had made it so that this is done in the Windows registry?
Comment 32 Maik Qualmann 2019-12-11 21:02:38 UTC
There has been no change lately on this part. It works here without any problems without the PATH variable. Please try again without PATH variable.

Maik
Comment 33 tlteebken-reg 2019-12-11 22:15:00 UTC
You are correct.  I tried again just now, it works as before.

What I had done in the intervening period is I had reinstalled DK 6.4, then today removed it and reinstalled the Beta.  So at bare minimum, my registry was probably 'dirty' at this point.  After updating PATH and a reboot, it's all back to normal.  Sorry for the false alarm.