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?".
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 )