Last active
November 15, 2024 16:22
-
-
Save brockthebear/5c05bfd51199bc82bf29c51fafd42208 to your computer and use it in GitHub Desktop.
Recursively find and convert files in place using ImageMagick and Mogrify
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
# This command would be run from the parent folder that: | |
# 1. contains the file(s) to be converted | |
# 2. has subdirectories that contain files to be converted | |
# 3. both of the above. | |
# This example finds all .tif files and converts them to .pdf, | |
# but any conversion supported by ImageMagick could be used here. | |
# If you don't have ImageMagick installed, you can do so here (https://imagemagick.org/script/download.php) | |
# for linux | |
for f in $(find . -name '*.tif'); | |
do echo "Converting $f"; | |
mogrify -format pdf "$f"; | |
done; | |
# for windows | |
# for /r /d %a in (*) do mogrify -format pdf "%~a\*.tif" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment