Skip to content

Fastest way to get size of many images #7266

Answered by snibgo
nik684 asked this question in Help
Discussion options

You must be logged in to vote

I can't just use a long list of file paths in one command run because of chars limitation.

What limitation? I assume a Windows limitation on command length.

I suggest using a list of the files in a text file, and referring to that file with the @ notation. For example, using Windows, we make a file named xlist.txt containing one filename per line:

dir *.png /b >xlist.txt

Then:

magick identify -ping -format "%f %wx%h\n" @xlist.txt

This shows results like:

x000009.png 200x200
x000010.png 200x200
x1.png 1040x976
x2.png 1040x976

For escapes %f etc, see https://imagemagick.org/script/escape.php. If doing this in a BAT script file, double each percent %%.

If we want the filename, width and…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nik684
Comment options

Answer selected by nik684
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants