Skip to content

Instantly share code, notes, and snippets.

@KZhidovinov
Created July 1, 2017 10:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KZhidovinov/b47e53f7f9423a647e15fc3633bb4f2c to your computer and use it in GitHub Desktop.
Save KZhidovinov/b47e53f7f9423a647e15fc3633bb4f2c 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 -c "$f" | convert -resize 60% -quality 85 - "$TARGET_FILE" && rm "$f";
echo "$f => $TARGET_FILE converted!"
done
@paulcgt
Copy link

paulcgt commented Mar 23, 2018

Thanks for this hey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment