[ruby] Check if file is a valid image
- by some guy
Hi all,
I'm using rmagick to manipulate image files. I use the ImageList.new on each file to get started. When I apply this method to an invalid image file I get the below error which interrupts the execution of the script:
RMagick.rb:1635:in `read': Improper image header (Magick::ImageMagickError)
Therefore I would like to be able to check whether a file is a valid image file before using this method.
Any ideas?
Thanks.