Thumbnails: Difference between revisions

Joshbuker (talk | contribs)
m Missed a typo
Added a header so the newer image format section is more visible
 
(5 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 sway or hyprland
* 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>


=== Enable HEIF Image Thumbnails ===
==== Thumbnails for newer image formats such as AVIF and JPEG XL ====
To enable thumbnails for HEIF image format use <code>libheif</code> to decode HEIF images and <code>libheif.out</code> to generate thumbnails.
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, ... }:


Thumbnails for the following MimeTypes are enabled: ''image/heif; image/avif.''
{
  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.libheif
     pkgs.f3d
    pkgs.libheif.out
   ];
   ];
  # 'heif.thumbnailer' is created in '/run/current-system/sw/share/thumbnailers'
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 150: Line 164:
     pkgs.nufraw
     pkgs.nufraw
     pkgs.nufraw-thumbnailer
     pkgs.nufraw-thumbnailer
     # Thumbnails form 'raw' data and include EXIF tags for Adobe-DNG images
     # 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";