computer:debian:raw-previews

This is an old revision of the document!


raw-Previews

siehe https://ocroquette.wordpress.com/2021/03/30/thumbnails-for-raw-images-in-gnome-nautilus/

/usr/local/bin/dcraw-thumbnailer
#!/bin/bash
 
# Usage:
#   dcraw-thumbnailer [size] [source] [destination]
 
# Exit with error on any error
set -e
 
size=$1
source=`echo "$2" | sed 's/file:\/\///'`
destination=$3
 
# Conversion table from EXIF orientation code to degrees (Bash 4 and newer)
declare -A conv=( ["1"]="0" ["3"]="180" ["6"]="90" ["8"]="270" )
 
# Read orientation with exiftool
# Triple -s : output only the value
# -n        : output numerical value, do not convert to human readable form
rotation_code=`exiftool -Orientation -s -s -s -n "$source"`
rotation_deg="${conv[$rotation_code]}"
 
# Extract the thumbnail (usually stored as JPEG) with dcraw, resize, rotate  and convert it.
# The target format will be inferred from the destination file name (usually PNG).
dcraw -c -e -w "$source" | convert -resize ${size}x${size} -rotate "${rotation_deg}" - "$destination"
~/.local/share/thumbnailers/dcraw.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/bin/dcraw-thumbnailer
Exec=/usr/bin/dcraw-thumbnailer %s %i %o
MimeType=image/x-sony-arw;image/x-canon-cr2;image/x-canon-crw;image/x-kodak-dcr;image/x-adobe-dng;image/x-epson-erf;image/x-kodak-k25;image/x-kodak-kdc;image/x-minolta-mrw;image/x-nikon-nef;image/x-olympus-orf;image/x-pentax-pef;image/x-fuji-raf;image/x-panasonic-raw;image/x-sony-sr2;image/x-sony-srf;image/x-sigma-x3f;

Damit auch große Raws Thumbnails erhalten:

gsettings set org.gnome.nautilus.preferences thumbnail-limit 500
rm -rf ~/.cache/thumbnails/
  • computer/debian/raw-previews.1720166034.txt.gz
  • Last modified: 2024/07/05 07:53
  • by spring