Skip to content

Instantly share code, notes, and snippets.

@KZhidovinov
Created July 1, 2017 10:26
Show Gist options
  • Save KZhidovinov/97015c33a5d8f7f297abdcf23a35c1ac to your computer and use it in GitHub Desktop.
Save KZhidovinov/97015c33a5d8f7f297abdcf23a35c1ac to your computer and use it in GitHub Desktop.
#/system/bin/sh
# Required to install imagemagick and dcraw via Termux
export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
export PREFIX=/data/data/com.termux/files/usr
export PATH=/data/data/com.termux/files/usr/bin:$PATH
if [ -z "$1" ]; then exit 0; fi;
for f in $@
do
export TARGET_FILE=${ echo $f | sed s/\.dng$/.jpg/i }
echo "Processing $f file..."
dcraw -w -d -c "$f" | convert -resize 80% -quality 85 - "$TARGET_FILE" && rm "$f";
echo "$f => $TARGET_FILE converted!"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment