I want to run a mogrify command on images whose filenames are listed in a text file and I can't find a related answer on here.
Does anyone know how to do this please?
I want to run a mogrify command on images whose filenames are listed in a text file and I can't find a related answer on here.
Does anyone know how to do this please?
On
To use a text list of images as input to ImageMagick you can just add a "@" at the beginning of the name of the text file like this...
mogrify -resize 480x @mylist.txt
If any of the filenames in the list have spaces in them, make sure they are enclosed in double quotes. So "mylist.txt" would look something like this...
"image one.jpg"
"image two.jpg"
"another image.jpg"
"and another one.jpg"
...
Edited to add:
The suggestion by webbernaut to cat and pipe the image list into the mogrify command should work if you modify it a bit. After the pipe, in the mogrify command you read in the image list with a "-", but ImageMagick still wants to work it like a text list, so the dash has to be preceded by an "@" like this...
cat mylist.txt | mogrify -resize 480x @-
Using the ImageMagick command line tool something like this. Below is how to glob a folder.
You can try a simple one liner in your terminal if using linux or unix OS (untested)