Last active
September 20, 2019 09:24
-
-
Save dpaluy/1f85ac4ba45e0f685ba1dd18fda1b306 to your computer and use it in GitHub Desktop.
Convert multipage images to JPG
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
| #!/bin/bash | |
| # Requires: http://www.graphicsmagick.org/ | |
| FILES="origin/*.TIF" | |
| OUTPUT_FOLDER="results/" | |
| SPLIT="_" | |
| for filename in $FILES; do | |
| fbname=$(basename "$filename" | cut -d. -f1) | |
| # gm convert "$filename" +adjoin "inputs/$fbname$SPLIT%02d.jpg" | |
| gm convert "$filename[0]" "$OUTPUT_FOLDER$fbname.jpg" | |
| echo "File $filename converted" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment