Thumbnails: Difference between revisions
m Fix typos and whitespace consistency |
Added a header so the newer image format section is more visible |
||
| (6 intermediate revisions by 3 users not shown) | |||
| Line 4: | Line 4: | ||
On minimal / custom desktop environments thumbnails in file explorers may not work by default. For example: | On minimal / custom desktop environments thumbnails in file explorers may not work by default. For example: | ||
* GNOME environments with the option <code>services.gnome.core-utilities.enable = false;</code> | * [[GNOME]] environments with the option <code>services.gnome.core-utilities.enable = false;</code> | ||
* Custom environments built from ground-up using window managers like | * Custom environments built from ground-up using window managers like [[Sway]] or [[Hyprland]] | ||
=== Save yourself hours of troubleshooting!! === | === Save yourself hours of troubleshooting!! === | ||
| Line 47: | Line 47: | ||
Thumbnails for the following MimeTypes are enabled: ''image/png; image/jpeg; image/bmp; image/x-bmp; image/x-MS-bmp; image/gif; image/x-icon; image/x-ico; image/x-win-bitmap; image/vnd.microsoft.icon; application/ico; image/ico; image/icon; text/ico; image/x-portable-anymap; image/x-portable-bitmap; image/x-portable-graymap; image/x-portable-pixmap; image/tiff; image/x-xpixmap; image/x-xbitmap; image/x-tga; image/x-icns; image/x-quicktime; image/qtif.'' | Thumbnails for the following MimeTypes are enabled: ''image/png; image/jpeg; image/bmp; image/x-bmp; image/x-MS-bmp; image/gif; image/x-icon; image/x-ico; image/x-win-bitmap; image/vnd.microsoft.icon; application/ico; image/ico; image/icon; text/ico; image/x-portable-anymap; image/x-portable-bitmap; image/x-portable-graymap; image/x-portable-pixmap; image/tiff; image/x-xpixmap; image/x-xbitmap; image/x-tga; image/x-icns; image/x-quicktime; image/qtif.'' | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"># configuration.nix | ||
# configuration.nix | |||
{ pkgs, ... }: | { pkgs, ... }: | ||
| Line 59: | Line 58: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
=== | ==== Thumbnails for newer image formats such as AVIF and JPEG XL ==== | ||
For newer image formats not included in <code>gdk-pixbuf</code> you can enable thumbnails by adding their specific image libraries into the system packages as seen below<syntaxhighlight lang="nix"># configuration.nix | |||
{ pkgs, ... }: | |||
{ | |||
environment.systemPackages = [ | |||
# For general HEIF container support (this includes the AVIF file format) | |||
pkgs.libheif.bin # provides heif-thumbnailer (the program that generates HEIF thumbnails) | |||
pkgs.libheif.out # provides heif.thumbnailer (allows for the viewing of HEIF thumbnails) | |||
<syntaxhighlight lang="nix"> | # For more newer AVIF specific support usually not needed if libheif is installed | ||
pkgs.libavif | |||
# For JXL(JPEG XL) support | |||
pkgs.libjxl | |||
# For WebP support | |||
pkgs.webp-pixbuf-loader | |||
]; | |||
# All of the thumbnailers are created in '/run/current-system/sw/share/thumbnailers' | |||
}</syntaxhighlight> | |||
=== Enable 3D Model Thumbnails === | |||
Thumbnails for various 3D model files can be enabled by installing f3d:<syntaxhighlight lang="nix"> | |||
# configuration.nix | # configuration.nix | ||
{ pkgs, ... }: | { pkgs, ... }: | ||
| Line 70: | Line 87: | ||
{ | { | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
pkgs. | pkgs.f3d | ||
]; | ]; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 150: | Line 164: | ||
pkgs.nufraw | pkgs.nufraw | ||
pkgs.nufraw-thumbnailer | pkgs.nufraw-thumbnailer | ||
# Thumbnails | # Thumbnails from 'raw' data and include EXIF tags for Adobe-DNG images | ||
(pkgs.writeTextFile { | (pkgs.writeTextFile { | ||
name = "my-custom-nufraw-thumbnailer"; | name = "my-custom-nufraw-thumbnailer"; | ||
| Line 162: | Line 176: | ||
}) | }) | ||
# MimeTypes not listed here but listed in the default nufraw.thumbnailer will continue displaying | # MimeTypes not listed here but listed in the default nufraw.thumbnailer will continue displaying | ||
# thumbnails generated from the 'embedded jpeg' without the EXIF metadata | |||
]; | ]; | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||