class image can not read PNG file

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
zhouyejoe
Posts: 1
Joined: 2011-08-04T07:13:24-07:00
Authentication code: 8675308

class image can not read PNG file

Post 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.
Post Reply