Is there a way to list image dimensions for .png files? I'm using this code, and I'm only getting the file dimensions of .jpg, and .gif files.
identify.exe -format "%f %w %y" *.*
I'm getting this error for .png files:
identify.exe: improper image header `ccp-pd-080-90.png' @ error/png.c/ReadPNGImage/3921.
Any help would be greatly appreciated! Thanks ya'll!
Is there a way to list image dimensions for .png files?
-
- Posts: 3
- Joined: 2016-03-31T16:43:20-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Is there a way to list image dimensions for .png files?
What is your IM version and version of libpng?
You can get them from
See http://www.imagemagick.org/script/escape.php
"%y" is not the height, but the resolution (dpi) in the vertical dimension. If you want the height, use "%h"
You can get them from
Code: Select all
convert -version
Code: Select all
convert -list format
"%y" is not the height, but the resolution (dpi) in the vertical dimension. If you want the height, use "%h"
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Is there a way to list image dimensions for .png files?
It sounds like a problem with that file. Please upload to somewhere like dropbox.com and paste the URL here.rickgut2016 wrote:improper image header `ccp-pd-080-90.png'
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2016-03-31T16:43:20-07:00
- Authentication code: 1151
Re: Is there a way to list image dimensions for .png files?
Here is my version info:
Version: ImageMagick 6.9.3-7 Q16 x64 2016-03-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
and
PNG* PNG rw- Portable Network Graphics (libpng 1.6.20)
I will use %h, thank you! Please let me know if I need a different version of anything. Thanks so much! This is a work project, so it would be sweet if I can get it working. Basically I need to list the dimensions (width, height) of 28 thousand files.. Looks like the files are .jpg, .gif, and .png.
Version: ImageMagick 6.9.3-7 Q16 x64 2016-03-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
and
PNG* PNG rw- Portable Network Graphics (libpng 1.6.20)
I will use %h, thank you! Please let me know if I need a different version of anything. Thanks so much! This is a work project, so it would be sweet if I can get it working. Basically I need to list the dimensions (width, height) of 28 thousand files.. Looks like the files are .jpg, .gif, and .png.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Is there a way to list image dimensions for .png files?
See snibgo's comment above about providing your png input file.
-
- Posts: 3
- Joined: 2016-03-31T16:43:20-07:00
- Authentication code: 1151
Re: Is there a way to list image dimensions for .png files?
Update: It looks like those .png files are corrupt. I should have checked that fist.. Thanks for the help all. I learned a few things