Bug 463132 - Gwenview Removed Support for All RAW Files (Regression)
Summary: Gwenview Removed Support for All RAW Files (Regression)
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 22.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-16 20:20 UTC by John
Modified: 2023-11-15 12:42 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.12.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2022-12-16 20:20:44 UTC
SUMMARY
Gwenview regression: Removed support for all types ARW (Sony), NEF (Nikon) and so on.


STEPS TO REPRODUCE
1. Get ARW, NEF or any RAW photo file
2. Display it in gwenview

OBSERVED RESULT
3. Fail, gwenview doesn't display Raw files anymore (all types).


EXPECTED RESULT
Revert changes to Gwenvie so it can display all RAW (currently none) again as before.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch (not Manjaro)
(available in About System)
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
kimageformats: 5.101
qt5-imageformats 5.15.7
qt6-imageformats 6.4.1
Comment 1 Nicolas Fella 2022-12-17 14:52:40 UTC
Mirco, you worked a lot on RAW stuff, any idea what's going on here?
Comment 2 Mirco Miranda 2022-12-17 15:54:39 UTC
(In reply to Nicolas Fella from comment #1)
> Mirco, you worked a lot on RAW stuff, any idea what's going on here?

If I disable libkdcraw support and recompile Gwenview, the raw files are displayed correctly. Gwenview treats RAW files differently from other images assuming there is no plugin capable of reading them. There is probably a logical conflict within the code due to the presence of the plugin.

The solutions can be the following:
1- disable KDCraw search from CMakeList of Gwenview (find_package(KF5KDcraw))
2- patch Gwenview to contemplate the presence of the plug-in

Solution 1 makes loading RAW files slow (plugin by default looks for maximum quality). To speed up the loading I added a hack to the plugin: by setting the quality to 1 in QImageReader, it does more or less what KDCraw does and makes loading much faster (sa: https://invent.kde.org/frameworks/kimageformats/-/blob/master/src/imageformats/raw_p.h). 
So, the solution 2 could be 
a) check if raw plugin is installed: set quality on raw file loading and bypass the KDRaw code 
or
b) use the current code an fix it to coexist with raw plugin (when installed).

I'm not familiar with Gwenview code, so I should do a deep debugging. Solution a) could be solved with a few lines of code.
Comment 3 Marian Kyral 2022-12-31 19:10:37 UTC
I have the same issue. RAW files works correctly in latest gwenview with kimageformats-5.98. But after update kimageformats to version 5.99+, RAW images fails to load.
Comment 4 Mirco Miranda 2023-01-02 07:44:42 UTC
This is a possible fix: https://invent.kde.org/graphics/gwenview/-/merge_requests/174
Comment 5 Nate Graham 2023-01-10 14:53:34 UTC
Git commit a7dc8feefc2147a08526b61bf361b63f78645ea0 by Nate Graham, on behalf of Mirco Miranda.
Committed on 10/01/2023 at 14:53.
Pushed by ngraham into branch 'master'.

Fixed coexistence between Qt Raw plugin and KDcraw

Use the RAW plugin to load raw images if installed:
- Previews are always generated from the RAW image at the fastest possible speed.
- Images are loaded in the highest possible quality (default plugin raw).
- If the raw plugin is not installed everything works as before (use KDcraw).
FIXED-IN: 22.12.2

M  +2    -1    lib/document/loadingdocumentimpl.cpp
M  +7    -1    lib/thumbnailprovider/thumbnailgenerator.cpp

https://invent.kde.org/graphics/gwenview/commit/a7dc8feefc2147a08526b61bf361b63f78645ea0
Comment 6 Nate Graham 2023-01-10 14:59:34 UTC
Git commit c419ec4a052b39eae7c17caf2a89d39d76b43777 by Nate Graham, on behalf of Mirco Miranda.
Committed on 10/01/2023 at 14:59.
Pushed by ngraham into branch 'cherry-pick-a7dc8fee'.

Fixed coexistence between Qt Raw plugin and KDcraw

Use the RAW plugin to load raw images if installed:
- Previews are always generated from the RAW image at the fastest possible speed.
- Images are loaded in the highest possible quality (default plugin raw).
- If the raw plugin is not installed everything works as before (use KDcraw).
FIXED-IN: 22.12.2


(cherry picked from commit a7dc8feefc2147a08526b61bf361b63f78645ea0)

M  +2    -1    lib/document/loadingdocumentimpl.cpp
M  +7    -1    lib/thumbnailprovider/thumbnailgenerator.cpp

https://invent.kde.org/graphics/gwenview/commit/c419ec4a052b39eae7c17caf2a89d39d76b43777
Comment 7 Martin Kyral 2023-11-15 12:42:45 UTC
I have no idea why Qt Raw plugin is being preferred over KDCraw, but the current implementation bring serious feature regression: while KDCraw implementation extracts insplit second already generated (in camera) preview jpeg from the raw file, the Qt Raw plugin implementation generates the jpeg data from raw, which takes considerable time even on pretty fast HW (on 10 core i7 ~ 7s). The same applies even to the thumbnailing. Imagine a folder containing some 500 raw images and you can do the math yourself.

This change renders raw support in gwenview virtually unusable.

I'd suggest either fixing the Qt Raw plugin implementation so it utilizes the embedded hi-res preview or preferring kdcraw over qt raw plugin. 

https://bugs.kde.org/show_bug.cgi?id=454206