Bug 471147

Summary: digiKam Snap package: webp files don't load, says "Failed to load image": add KImageFormats dependency.
Product: [KDE Neon] neon Reporter: Philipp Keck <philipp.keck>
Component: SnapsAssignee: Scarlett Moore <sgmoore>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin, neon-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: One of the files that fails to load.

Description Philipp Keck 2023-06-17 11:40:21 UTC
Created attachment 159740 [details]
One of the files that fails to load.

SUMMARY

According to the release notes, 8.0.0 supports webP. But I get an error and don't see the images.


STEPS TO REPRODUCE
1. View a folder that contains webp files (example attached).
2. Open one of those files.

OBSERVED RESULT

In the overview, only a green dummy thumbnail is shown. In the per-file view, the view remains empty (black) and at the top right it says "Failed to load image".

EXPECTED RESULT

Renders the image. Like nomacs, Xviewer, GIMP and Dolphin do just fine for the same file(s).

SOFTWARE/OS VERSIONS
Mint based on Ubuntu 22.04.
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.3
Comment 1 Maik Qualmann 2023-06-17 12:43:44 UTC
The WebP file works without problems here. Do you use the digiKam Ubuntu packages or our AppImage?

Please set the Qt Debug variable and give us the log from the terminal when trying to open the image.

https://www.digikam.org/contribute/

Maik
Comment 2 Philipp Keck 2023-06-17 13:00:57 UTC
I use the snap: https://snapcraft.io/digikam

This repeats for every one of my webp files when I open the directory:

```
digikam.metaengine: Check ExifTool availability: false
digikam.metaengine: ExifTool is not available to load metadata...
digikam.metaengine: Loading metadata with "Exiv2" backend from "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.general: Trying to get thumbnail from "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp" ( "image" )
digikam.general: Trying to get thumbnail with Exiv2 for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.general: Trying to get thumbnail with DImg preview for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.general: Trying to get thumbnail from Embedded preview with libraw for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to get thumbnail from half preview with libraw for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.general: Trying to get thumbnail from Embedded preview with Exiv2 for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.dimg: "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp" : Unknown image format !!!
digikam.general: mimetype =  ""  ext =  "WEBP"
digikam.general: Cannot create thumbnail for "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
digikam.general: Thumbnail is null for  "/media/..../2577a254-6362-4df1-988e-f7dc44320a90.webp"
```

And when I open one of those files, it's this:

```
digikam.metaengine: Check ExifTool availability: false
digikam.metaengine: ExifTool is not available to load metadata...
digikam.metaengine: Loading metadata with "Exiv2" backend from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp" ( "image" )
digikam.general: Trying to get thumbnail with Exiv2 for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail with DImg preview for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from Embedded preview with libraw for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to get thumbnail from half preview with libraw for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from Embedded preview with Exiv2 for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.dimg: "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp" : Unknown image format !!!
digikam.general: mimetype =  ""  ext =  "WEBP"
digikam.general: Cannot create thumbnail for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Thumbnail is null for  "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.metaengine: ExifToolProcess::command(): cannot process command with ExifTool ("-json", "-G:0:1:2:4:6", "-l", "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp")
digikam.metaengine: ExifTool cannot be sent: "Load Metadata"
digikam.metaengine: Check ExifTool availability: false
digikam.metaengine: ExifTool is not available to load metadata...
digikam.metaengine: Loading metadata with "Exiv2" backend from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Metadata loading with Exiv2 took 1 ms ( true )
digikam.general: Try to get preview from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Preview quality:  0
digikam.metaengine: Check ExifTool availability: false
digikam.metaengine: ExifTool is not available to load metadata...
digikam.metaengine: Loading metadata with "Exiv2" backend from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Try to load DImg preview from: "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.dimg: "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp" : Unknown image format !!!
digikam.general: Cannot extract preview for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Stacked View Mode :  1
digikam.general: FocusPointsGroup: no Point to load
digikam.metaengine: Check ExifTool availability: false
digikam.metaengine: ExifTool is not available to load metadata...
digikam.metaengine: Loading metadata with "Exiv2" backend from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp" ( "image" )
digikam.general: Trying to get thumbnail with Exiv2 for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail with DImg preview for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from Embedded preview with libraw for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to get thumbnail from half preview with libraw for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Trying to get thumbnail from Embedded preview with Exiv2 for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.dimg: "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp" : Unknown image format !!!
digikam.general: mimetype =  ""  ext =  "WEBP"
digikam.general: Cannot create thumbnail for "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
digikam.general: Thumbnail is null for  "/media/..../9abd9ca2-09d8-4617-96cf-263979c5ebcc.webp"
```
Comment 3 Maik Qualmann 2023-06-17 13:31:57 UTC
Snap is a bad container package format for digiKam. It uses a sandbox and has many known issues. The snap package does not appear to contain the KImageFormat plugin. KImageFormat is also used by Gwenview. Also, ExifTool doesn't work either. Report the problem to Ubuntu, they should finally build a native digiKam package.
Use our AppImage instead, just make it executable and start it. The upcoming digiKam-8.1.0 as AppImage can be downloaded here:

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

Maik
Comment 4 Philipp Keck 2023-06-17 14:28:25 UTC
First of all, I can confirm that the AppImage doesn't have this issue.

> Report the problem to Ubuntu, they should finally build a native digiKam package.

They already have, right? https://packages.ubuntu.com/jammy/digikam

Just with jammy it's stuck at 7.5.0, which doesn't support webp yet.

> Use our AppImage instead, just make it executable and start it.

I'm a bit hesitant, because it wouldn't auto-update, as far as I understand. One of my reasons for using Linux instead of Windows is not having to update each and every application manually / separately.

> The snap package does not appear to contain the KImageFormat plugin.

Could that be changed? I can't find where the snap is built from.
Comment 5 Philipp Keck 2023-06-17 20:03:13 UTC
Found the snap config here: https://invent.kde.org/packaging/snapcraft-kde-applications/-/blob/Neon/release/digikam/snapcraft.yaml

Sadly running it locally requires LXD and thus a bunch of disk space and patience that I don't currently have.

Could we solve this issue by adding something like `libkimageformat` (though that particular probably one doesn't exist, I made it up) to one of the packages sections in that config file? (And can we have the CI do the building, so it doesn't require a local build environment?)
Comment 6 caulier.gilles 2023-06-20 05:50:49 UTC
Hi Scarlett,

I moved this report in Neon/Snaps packaging section...

Including KF5::KImageFormats dependency will solve this issue at run-time. digiKam has a Qt Image Loader plugin which will automatically support WebP if KImageFormats modules are present.

Best 

Gilles Caulier
Comment 7 Scarlett Moore 2023-11-11 09:50:52 UTC
https://invent.kde.org/graphics/digikam/-/merge_requests/231 Will fix this.
Comment 8 Scarlett Moore 2023-11-13 10:28:00 UTC
Git commit c14d969975d3e17e09510227742a06bc81a66965 by Scarlett Moore.
Committed on 11/11/2023 at 10:46.
Pushed by cgilles into branch 'master'.

snapcraft: Fix image formats missing.

M  +1    -0    project/bundles/snap/snapcraft.yaml

https://invent.kde.org/graphics/digikam/-/commit/c14d969975d3e17e09510227742a06bc81a66965