Copy the widths of images to clipboard (Mac)

0

I have a bunch of images in a folder and would like an easy way to either copy all of the widths to the clipboard or export them to a document. I know I can Get Info and copy it from the window that pops up, but that's way too time-consuming with the number of images I'm working with.

Any suggestions on a way to speed this up or automate it?

Patrick Mattei

Posted 2017-11-03T14:01:49.607

Reputation: 3

Answers

0

If Mac OSX has the file command as on Linux it can output image info, eg:

$ file out.png
out1.png: PNG image data, 542 x 149, 8-bit/color RGB, non-interlaced

or you can use ImageMagick which has a command too:

$ identify out1.png
out1.png PNG 542x149 542x149+0+0 8-bit sRGB 11.1KB 0.000u 0:00.000

$ identify -format '%f: %w\n' *.png *.jpg
out1.png: 542
out3.jpg: 1134

meuh

Posted 2017-11-03T14:01:49.607

Reputation: 4 273

Awesome, this worked! for anyone else, I used: file format '%f: %w\n' *.png *.jpg

on the folder, and it returned info on all of the images within. I can easily get just the widths now. – Patrick Mattei – 2017-11-03T14:35:13.337