NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.14k stars 14.17k forks source link

Plasma 6 packages do not handle webp or avif image formats #304523

Open chermnyx opened 7 months ago

chermnyx commented 7 months ago

Describe the bug

Multiple Plasma 6 packages cannot use webp or avif images

So far I've found the following problems:

Probably there are other packages affected by the same issue

The problem is similar to https://github.com/NixOS/nixpkgs/issues/292375

Expected behavior

Plasma 6 apps should handle supported image formats other than .jpg and .png

Screenshots

image

Notify maintainers

@k900

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.4-zen1, NixOS, 24.05 (Uakari), 24.05.20240412.cfd6b5f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/yy5l09gfsagkv8rswblknmsjc2gyr20d-source`

nixpkgs from flakes.lock:

"nixpkgs": {
  "locked": {
    "lastModified": 1712963716,
    "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=",
    "owner": "nixos",
    "repo": "nixpkgs",
    "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176",
    "type": "github"
  },
  "original": {
    "owner": "nixos",
    "ref": "nixos-unstable",
    "repo": "nixpkgs",
    "type": "github"
  }
},

Add a :+1: reaction to issues you find important.

lboklin commented 6 months ago

Same problem with Krita plugins, in particular the krita-ai-diffusion plugin. Krita is a Qt5 package and the plugin in question is a Python script.

K900 commented 6 months ago

You probably want to install qtimageformats globally, I'm not sure adding it to every single place where it could potentially be used is worth it.

lboklin commented 6 months ago

You probably want to install qtimageformats globally, I'm not sure adding it to every single place where it could potentially be used is worth it.

But that wouldn't solve its absence from Krita's python environment, surely?

K900 commented 6 months ago

It should, since it's just a Qt plugin.

lboklin commented 6 months ago

Well, that's dirty. Packages should state their dependencies, so I would disagree with

I'm not sure adding it to every single place where it could potentially be used is worth it.

K900 commented 6 months ago

If that Krita plugin can't work without it, then we need to think about how to propagate that dependency to Krita if the plugin is used. For Dolphin and such, we can't really expect to add every single image format to every single program that may want to display it.

lboklin commented 6 months ago

I agree that it would be better for scripts to be packaged and their dependencies propagated, but Qt applications that are heavily centred around image handling and support custom scripts I think should be packaged with a reasonable set of libraries available at runtime. Common image formats such as webp are likely to appear in custom scripts, so unless there are plans to package python script plugins (and not just binary plugins), a generous python environment would provide a better UX.

chermnyx commented 6 months ago

You probably want to install qtimageformats globally, I'm not sure adding it to every single place where it could potentially be used is worth it.

Maybe it should be installed automatically when services.desktopManager.plasma6.enable is true? Installing the plugin globally resolves the problem, but the default behavior might be confusing

K900 commented 6 months ago

We could do that, yeah. Do you want to submit a PR?

danwdart commented 6 months ago

This also appears in gwenview not showing heif files despite it supposedly being compiled with qtimageformats - does qtimageformats have to be compiled differently?

toast003 commented 6 months ago

Also an issue for the media player applet when playing youtube videos, since the thumbnails are webp images

fin444 commented 5 hours ago

Trying to reproduce the specific things mentioned in this thread, on unstable 24.11.20241105.4aa3656:

As far as I can tell, adding qtimageformats should allow for improved WEBP support, but aside from that it will have limited benefits according to the wiki page. Formats like AVIF and HEIF are provided by kimageformats instead, which is already included in the environment when plasma6 is enabled.

https://github.com/NixOS/nixpkgs/blob/4aa36568d413aca0ea84a1684d2d46f55dbabad7/nixos/modules/services/desktop-managers/plasma6.nix#L75

That said, I don't see a reason not to include qtimageformats as well.