summarylogtreecommitdiffstats
path: root/dcraw-thumbnailer
blob: 7b125ec6236798282dc589b3cc509a5d8c6d2f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Usage:
#   dcraw-thumbnailer [size] [source] [destination]

# Exit with error on any error
set -e

# Create tmp file
tmpfile=$(mktemp /tmp/dcraw-thumb.XXXXXX)

# Extract embedded thumbnail
/usr/bin/dcraw -c -e -w "${2}" > "${tmpfile}"

# Create thumbnail
/usr/bin/gdk-pixbuf-thumbnailer -s "${1}" "${tmpfile}" "${3}"

# Remove tmp file
rm "${tmpfile}"