Error when trying to run this script

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Namingishard

Error when trying to run this script

Post by Namingishard »

When I try and run this script

Code: Select all

#! /bin/sh

i="$1"

height=`identify -format %h ${i}`
width=`identify -format %w ${i}`

echo "${width} x ${height}"
I get this error

Code: Select all

identify: UnableToOpenConfigureFile `delegates.xml'.
identify: NoDecodeDelegateForThisImageFormat `namingishard.png'.
identify: UnableToOpenConfigureFile `delegates.xml'.
identify: NoDecodeDelegateForThisImageFormat `namingishard.png'.
 x
Im running Ubuntu 7.10.
Maxwell

Re: Error when trying to run this script

Post by Maxwell »

Hello,

Does identify work on its own on the command line?

Your script ran without errors on my system (openSUSE 10.3). I used it with TIFFs, GIFs and PNGs. From the errors, it looks like there are missing files since it seems like it can't read a PNG and identify can't find a file. Maybe re-install ImageMagick?

Once its working, identify can do it in one line like this (it'll run twice as fast :-) )

Code: Select all

#! /bin/sh

i="$1"

identify -format "%w x %h" ${i}
Good luck,
Max
Namingishard

Re: Error when trying to run this script

Post by Namingishard »

Thanks for the help, I reinstalled it from source and it worked this time.
And thanks for the code tip.
Post Reply