Page 1 of 1

class image can not read PNG file

Posted: 2011-08-04T07:34:25-07:00
by zhouyejoe

Code: Select all

int imagecheck( const void * data, const unsigned long uilength ){ 
          Blob blob( data, uilength );
          Image orilImage;
          try
          {
                 orilImage.read(blob);
          }
         catch (std::exception& e)
        {
           ....
        }
I want to read a file from binary data in memory as to check whether it is a pic or not.
I finally succeed when the file is in the format of JPG or BMP or GIF, but when I choose a pic in the format of PNG, it failed again and again.
When the class image read the blob, it threw exception.
I don't know whether I need to do some other operations if I read a PNG file.
or Magick++ do not support PNG in this way.
My version of ImageMagick is 6.7.1-1 and the libpng is 1.5.5beta04.