Extracting height and width of PNG's to a csv file

Started by slowkid, December 08, 2022, 09:12:52 PM

Previous topic - Next topic

slowkid

Windows 10

I have a directory of .png images
I have exif.exe in the image directory
I have an empty file titled "output.csv" in the image directory

I need to produce a csv file containing:
  • image filename
  • image height
  • image width

I have been trying variations on the following without success:

exiftool -csv -ext png -ImageWidth -ImageHeight / > output.csv
I get "1 directory scanned, 0 image files read"

If one of you lovely people could help me sort out the proper CLI input / process for my use case I would be very grateful.


Phil Harvey

Instead of "/" in your command you need to use the path name for the directory you want to scan.  "/" is for the root directory, which apparently doesn't contain the PNG images.  You can drag and drop the folder onto the command window instead of typing the path name if you want.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

I would guess that you want to scan the current directory, in which case you would use a single dot .

exiftool -csv -ext png -ImageWidth -ImageHeight . >output.csv
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

slowkid

Thank you both!

StarGeek, your solution did the trick.