Created
July 1, 2017 10:27
-
-
Save KZhidovinov/b47e53f7f9423a647e15fc3633bb4f2c to your computer and use it in GitHub Desktop.
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
#/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this hey.