Thumbnails: Difference between revisions

Joshbuker (talk | contribs)
Update RAW thumbnail recommendations and use `pkgs.` instead of `with pkgs;`
Joshbuker (talk | contribs)
Move gdk-pixbuf above nufraw for RAW processing
Line 82: Line 82:


=== Enable RAW (Camera) Image Thumbnails ===
=== Enable RAW (Camera) Image Thumbnails ===
==== gdk-pixbuf thumbnailer ====
The gdk-pixbuf thumbnailer can also generate thumbnails (from 'embedded jpeg') for RAW camera image formats. It cannot decode 'raw' image data but can read the 'embedded jpeg'.
<syntaxhighlight lang="nix">
# configuration.nix
{ pkgs, ... }:
{
  environment.systemPackages = [
    pkgs.gdk-pixbuf
    # Allow gdk-pixbuf to thumbnail RAW photos by extracting the embedded jpeg
    (pkgs.writeTextFile {
      name = "raw-embedded-jpeg-thumbnailer";
      destination = "/share/thumbnailers/raw-embedded-jpeg.thumbnailer";
      text = ''
        [Thumbnailer Entry]
        TryExec=gdk-pixbuf-thumbnailer
        Exec=gdk-pixbuf-thumbnailer -s %s %u %o
        MimeType=image/x-canon-crw;image/x-canon-cr2;image/x-canon-cr3;image/x-adobe-dng;image/x-dng;
      '';
    })
    # Other MimeTypes that include embedded jpeg may work as well (e.g. Nikon .nef, Sony .arf, etc)
    # Test other formats by adding them above
  ];
}
</syntaxhighlight>


==== nufraw-thumbnailer ====
==== nufraw-thumbnailer ====
Line 144: Line 173:


}</syntaxhighlight>
}</syntaxhighlight>
==== gdk-pixbuf thumbnailer ====
The gdk-pixbuf thumbnailer can also generate thumbnails (from 'embedded jpeg') for RAW camera image formats. It cannot decode 'raw' image data but can read the 'embedded jpeg'.
<syntaxhighlight lang="nix">
# configuration.nix
{ pkgs, ... }:
{
  environment.systemPackages = [
    pkgs.gdk-pixbuf
    # Allow gdk-pixbuf to thumbnail RAW photos by extracting the embedded jpeg
    (pkgs.writeTextFile {
      name = "raw-embedded-jpeg-thumbnailer";
      destination = "/share/thumbnailers/raw-embedded-jpeg.thumbnailer";
      text = ''
        [Thumbnailer Entry]
        TryExec=gdk-pixbuf-thumbnailer
        Exec=gdk-pixbuf-thumbnailer -s %s %u %o
        MimeType=image/x-canon-crw;image/x-canon-cr2;image/x-canon-cr3;image/x-adobe-dng;image/x-dng;
      '';
    })
    # Other MimeTypes that include embedded jpeg may work as well (e.g. Nikon .nef, Sony .arf, etc)
    # Test other formats by adding them above
  ];
}
</syntaxhighlight>


== '''Creating Custom Thumbnailers''' ==
== '''Creating Custom Thumbnailers''' ==