Thumbnails: Difference between revisions
consolidated repeated code from various code blocks into a single block in new 'troubleshooting sub-sesction' |
Update RAW thumbnail recommendations and use `pkgs.` instead of `with pkgs;` |
||
| Line 33: | Line 33: | ||
{ | { | ||
environment.systemPackages = | environment.systemPackages = [ | ||
ffmpeg-headless | pkgs.ffmpeg-headless | ||
ffmpegthumbnailer | pkgs.ffmpegthumbnailer | ||
]; | ]; | ||
| Line 53: | Line 53: | ||
{ | { | ||
environment.systemPackages = | environment.systemPackages = [ | ||
gdk-pixbuf | pkgs.gdk-pixbuf | ||
]; | ]; | ||
| Line 71: | Line 71: | ||
{ | { | ||
environment.systemPackages = | environment.systemPackages = [ | ||
libheif | pkgs.libheif | ||
libheif.out | pkgs.libheif.out | ||
]; | ]; | ||
| Line 84: | Line 84: | ||
==== nufraw-thumbnailer ==== | ==== nufraw-thumbnailer ==== | ||
{{Warning|nufraw has not been updated since March 2nd, 2020, and may be insecure.}} | |||
To enable thumbnails for camera RAW format use <code>nufraw</code> to decode RAW images and <code>nufraw-thumbnailer</code> to generate thumbnails. | To enable thumbnails for camera RAW format use <code>nufraw</code> to decode RAW images and <code>nufraw-thumbnailer</code> to generate thumbnails. | ||
| Line 92: | Line 93: | ||
{ | { | ||
environment.systemPackages = | environment.systemPackages = [ | ||
nufraw | pkgs.nufraw | ||
nufraw-thumbnailer | pkgs.nufraw-thumbnailer | ||
]; | ]; | ||
| Line 119: | Line 120: | ||
Eg: Generate thumbnails from 'raw' data (not 'embedded jpeg') + respect EXIF (eg: rotation) metadata + add support for additional camera formats | Eg: Generate thumbnails from 'raw' data (not 'embedded jpeg') + respect EXIF (eg: rotation) metadata + add support for additional camera formats | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"># configuration.nix | ||
# configuration.nix | |||
{ pkgs, ... }: | { pkgs, ... }: | ||
| Line 126: | Line 126: | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
nufraw | pkgs.nufraw | ||
nufraw-thumbnailer | pkgs.nufraw-thumbnailer | ||
# Thumbnails form 'raw' data and include EXIF tags for Adobe-DNG images | # Thumbnails form 'raw' data and include EXIF tags for Adobe-DNG images | ||
( | (pkgs.writeTextFile { | ||
name = "my-custom-nufraw-thumbnailer"; | |||
destination = "/share/thumbnailers/my-custom-nufraw.thumbnailer"; | |||
text = '' | |||
[Thumbnailer Entry] | |||
TryExec=nufraw-batch | |||
Exec=nufraw-batch --silent --size %s --out-type=png --output=%o %i | |||
MimeType=image/x-adobe-dng;image/x-dng; | |||
''; | |||
}) | |||
# 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 form the 'embedded jpeg' without the EXIF metadata | # thumbnails generated form the 'embedded jpeg' without the EXIF metadata | ||
]; | ]; | ||
} | }</syntaxhighlight> | ||
</syntaxhighlight> | |||
==== gdk-pixbuf thumbnailer ==== | ==== gdk-pixbuf thumbnailer ==== | ||
| Line 152: | Line 155: | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
gdk-pixbuf | 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 | |||
]; | ]; | ||