Thumbnails: Difference between revisions

Add exiv2-thumbnailer
m Use same MimeType
 
(One intermediate revision by the same user not shown)
Line 97: Line 97:
gdk-pixbuf can be used to generate thumbnails for RAW camera image formats by reading the embedded jpeg. This embedded jpeg is typically generated in the camera or overwritten by your RAW editing software, and may not match what the photo looks like when opened in a viewer or editor.
gdk-pixbuf can be used to generate thumbnails for RAW camera image formats by reading the embedded jpeg. This embedded jpeg is typically generated in the camera or overwritten by your RAW editing software, and may not match what the photo looks like when opened in a viewer or editor.


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix"># configuration.nix
# configuration.nix
{ pkgs, ... }:
{ pkgs, ... }:


Line 142: Line 141:


         base="$(basename "$1")"
         base="$(basename "$1")"
         preview="$tmpdir/${base%.*}-preview1.jpg"
         preview="$tmpdir/\${base%.*}-preview1.jpg"
         [ ! -f "$preview" ] && preview="${preview%.*}.tif"
         [ ! -f "$preview" ] && preview="${preview%.*}.tif"


         magick "$preview" -thumbnail "${3}x${3}>" -strip "png:$2"
         magick "$preview" -thumbnail "\${3}x\${3}>" -strip "png:$2"
       '';
       '';
     })
     })
Line 156: Line 155:
         TryExec=exiv2-thumbnailer
         TryExec=exiv2-thumbnailer
         Exec=exiv2-thumbnailer %i %o
         Exec=exiv2-thumbnailer %i %o
         MimeType=image/x-adobe-dng;image/x-sony-arw;image/x-nikon-nef;
         MimeType=image/x-canon-crw;image/x-canon-cr2;image/x-canon-cr3;image/x-adobe-dng;image/x-dng;
       '';
       '';
     })
     })