Created
July 1, 2017 10:26
-
-
Save KZhidovinov/97015c33a5d8f7f297abdcf23a35c1ac to your computer and use it in GitHub Desktop.
This file contains 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
#/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