Created
December 11, 2019 21:28
-
-
Save angryziber/0b9eca0e5e0c07bd0708e4aed0d4609b to your computer and use it in GitHub Desktop.
GNOME raw photo thumbnailer (cr2, nef, etc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Save this script to /bin in order to generate RAW photo thumbnails in Ubuntu | |
# Save raw.thumbnailer to /usr/share/thumbnailers | |
# Note: you cannot put the script to e.g. /home, as thumnailers are now run in a sandbox provided by bwrap | |
# Requires exiftool and imagemagick (note: use real binary name of convert instead of /etc/alternatives, because it's not accessible from bwrap) | |
INPUT=$1 | |
OUTPUT=$2 | |
SIZE=$3 | |
# use -PreviewImage to get a slower, but high quality thumbnail | |
exiftool -ThumbnailImage -b $INPUT | convert-im6.q16hdri -resize "${SIZE}x${SIZE}>" jpg:- $OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Thumbnailer Entry] | |
Exec=/bin/bash /bin/raw-thumbnailer.sh %i %o %s | |
MimeType=image/x-3fr;image/x-adobe-dng;image/x-arw;image/x-bay;image/x-canon-cr2;image/x-canon-crw;image/x-cap;image/x-cr2;image/x-crw;image/x-dcr;image/x-dcraw;image/x-dcs;image/x-dng;image/x-drf;image/x-eip;image/x-erf;image/x-fff;image/x-fuji-raf;image/x-iiq;image/x-k25;image/x-kdc;image/x-mef;image/x-minolta-mrw;image/x-mos;image/x-mrw;image/x-nef;image/x-nikon-nef;image/x-nrw;image/x-olympus-orf;image/x-orf;image/x-panasonic-raw;image/x-pef;image/x-pentax-pef;image/x-ptx;image/x-pxn;image/x-r3d;image/x-raf;image/x-raw;image/x-rw2;image/x-rwl;image/x-rwz;image/x-sigma-x3f;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-sr2;image/x-srf;image/x-x3f; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment