How do I judge a file's type?
Posted: 2008-01-22T20:01:01-07:00
Magick::Image test1("test.txt");//will crash when running
Magick::Image test2;
test2.read("test.txt");//will also crash
I notise that read(std::string& imgSpec) does not return a value,so I cannot control my program to ignore files which are not images.
Is there any way to known a file's type, or just tell me whether a file is a image?
thanks
Magick::Image test2;
test2.read("test.txt");//will also crash
I notise that read(std::string& imgSpec) does not return a value,so I cannot control my program to ignore files which are not images.
Is there any way to known a file's type, or just tell me whether a file is a image?
thanks