webp not supported in snap or flatpak packages

Bug #2001708 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Confirmed
Undecided
Unassigned

Bug Description

In Pinta 2.1 release notes is stated that Pinta supports WebP image format.

Installed Pinta 2.1 using snap package and also flatpak package on Ubuntu 22.10 and in both cases WebP does not work. Can't open WebP image and also can't save WebP image.

I usually use .jpg or .png, so it is not super important for me, but it may be for some other users.

From release notes https://www.pinta-project.com/releases/2-1 there is info that package webp-pixbuf-loader should also be installed. But isn't it the whole point of snap or flatpak that all of dependencies should be packaged.

Can you please contact downstream snap and flatpak maintainers to also package WebP package to enable support for WebP.

If for some reason WebP is not been able to work for Linux snap or flatpak, then please update release notes.

Revision history for this message
Cameron White (cameronwhite91) wrote :

We probably just need to update the docs / release notes to say that it may be supported in the future.
It's really just a matter of packaging the webp-pixbuf-loader package, which should be easy for normal distro packages (e.g. Arch Linux or Debian). For snap it seems like it might require some more work (https://github.com/MrCarroll/pinta-snap/pull/10), not sure about flatpak

Changed in pinta:
milestone: none → 2.2
status: New → Confirmed
Revision history for this message
Cameron White (cameronwhite91) wrote :

I've updated the release notes to mention this.

Revision history for this message
James Carroll (james-carroll) wrote :

I'd have assumed the flatpak to be in a similar position with the ideal scenario being to include it in the Gnome runtimes they use.

For the snap, Webp needs to be added to the Gnome-42-2204-sdk snap (which also deals with GTK3), then once this is upstreamed, the Gnome-42-2204 snap needs to be rebuilt against the latest SDK snap, and then distributed to users.

Pinta would then gain webp support automatically, with a caveat, the caches for which pixbufs are installed wouldn't be regenerated when the content snap updates, only when Pinta itself updates. New installs would work with Webp fine, but existing installs would have the library but wouldn't use it because they don't know it's there.

So, about a month or so after the content snap being updated, there'd then be a rebuild of the Pinta snap (Likely advertising .webp support as a valid Mime in the .desktop file, so that right clicking and "Open With" would correctly offer Pinta as a choice), and then that would bring up the majority of the existing installs and enable the webp support for them.

This way, every GTK snap on the newer Snap extensions gets Webp, not just Pinta; and there's no bad hacks involved.

Revision history for this message
grofaty (grofaty) wrote :

@Cameron, thank you for updating Release Notes.

@James, who is going to go up the rabbit hole and make sure WebP is added to Gnome snap? Are you willing to make this route?

@Cameron, I have manually logged into Github and downloaded https://github.com/PintaProject/Pinta/suites/10148982799/artifacts/495778566 file (last Pinta commit from 2.1 branch), extracted the zip and run the ./Pinta on Ubuntu 22.10 and I could normally open WebP file and also was able to save new file to WebP format. May I suggest to add this download file to https://github.com/PintaProject/Pinta/releases/tag/2.1 to Assets section with name something like "Pinta-2.1-Linux_includes_WebP_support.tar.gz" and then update Release Notes that for users on Linux that would like to use WebP support can download, untar the file and run ./Pinta file.

Revision history for this message
James Carroll (james-carroll) wrote :

I'll try propose a patch to the Gnome snap in the next few days.

Revision history for this message
Cameron White (cameronwhite91) wrote :

After doing some searching around, the flatpak for evince previously did this by overwriting the default loaders.cache from gdk-pixbuf (not sure if snap allows this). The new approach seems to be calling gdk_pixbuf_init_modules() from the application to load some additional pixbuf plugins from a specific directory. The latter seems like a cleaner solution, although I think that requires manually building webp-pixbuf-loader as well when building the snap

Revision history for this message
James Carroll (james-carroll) wrote :

It sounds like gdk_pixbuf_init_modules would be fine, there's no issue putting the library in the snap under a known path. But the logic to generate the loaders.cache would only ever point to the Gnome snap, which is why just bundling it alone didn't work.

I have also proposed this to the Gnome snap, which I'm hoping would also work.
https://github.com/ubuntu/gnome-sdk/pull/96

Revision history for this message
James Carroll (james-carroll) wrote :

The above patch was merged so new installations of Pinta via Snap should have webp support "soon".

Revision history for this message
Cameron White (cameronwhite91) wrote :

That's great, thanks for working on that!

Revision history for this message
James Carroll (james-carroll) wrote :

I believe the Gnome content snap now has the webp-pixbuf-libraries in it in the snable release. As such, new installations of the Pinta snap should be able to read/write webp files.

In a few weeks (to give the content snap time to rollout), I'll release an update to the snap to add webp as a supported MIME type for the right click > open with functionality. This should then regenerate the loaders.cache of existing users, enabling webp for them too.

To test/enable this sooner, you'd need to run `sudo snap refresh`, to ensure the content snap is up to date, and then `sudo snap remove --purge pinta && sudo snap install pinta`, to regenerate the caches.

As such, the rest of this bug can probably be tackled as just a Flatpak specific problem.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Great, thanks for the update!

Changed in pinta:
milestone: 2.2 → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.