why sometimes magick++ cant open tiff 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
hongmysky

why sometimes magick++ cant open tiff file.

Post by hongmysky »

error:
terminate called after throwing an instance of 'Magick::WarningCoder'
what(): a.out: /home/gfile/data023/1/55/GFFA7101201006041402278661000012: unknown field with tag 59932 (0xea1c) encountered. `TIFFReadDirectory'

file:
[gfile@localhost huhong]$ file /home/gfile/data023/1/55/GFFA7101201006041402278661000012
/home/gfile/data023/1/55/GFFA7101201006041402278661000012: TIFF image data, little-endian


//src code
#include <iostream.h>

#include <Magick++.h>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
//Image image( "100x100", "white" );
//image.pixelColor( 49, 49, "red" );
//image.type( GrayscaleType );
//image.write( "red_pixel_gry.png" );

char str[][512]={
"/home/gfile/data023/1/55/GFFA7101201006041402278661000012",
"/home/gfile/data023/238/21/AA075501201006041113048192000020",
};

for (int i=0;str[0]!='\0';++i)
{
try
{
Image imagesrc;
imagesrc.read(str);
printf("******read OKOKOKOK str[%d]=[%s]\n\n", i,str);
}
catch(Error& my_error)
{
//printf("catch ERROR.str[%d]=[%s]:errmsg:[%s]\n\n",i,str,my_error.what());
std::cout<<"catch ERROR"<<"str["<<i<<"]="<<str<<my_error.what()<<std::endl;
}
}

/*
try
{
imagesrc.read("/home/gfile/data023/238/21/AA075501201006041113048192000020");
//printf("%d\n", iret);
}
catch(...)
{
printf("AA075501201006041113048192000020 error\n");
}

return 0;
}
Post Reply