bigjim
YaBB Newbies
Offline

I Love YaBB 2!
Posts: 1
|
I use CxImage to open a 4-page TIFF image file, i can get 1st, 3rd and 4th page information, however i can not retrieve 2nd page data, it always returns 1st page information (image width/height), is it a bug of CxImage or i did something wrong? I downloaded CxImage 6 months ago.
The code snippet :
FILE *inFile = fopen(file_name, "rb"); if (inFile == NULL) return;
CxImage *img = new CxImage(); img->SetFrame(-1); img->Decode(inFile, 6); // return 4 int NumFrames = img->GetNumFrames(); // 1st page img->SetFrame(0); img->Decode(inFile, 6); int w = img->GetWidth(); int h = img->GetHeight();
// something is wrong here. // 2nd page, width/height are same as 1st page width/height, actually they are not img->SetFrame(1); img->Decode(inFile, 6); w = img->GetWidth(); h = img->GetHeight();
// 3rd page, everything is correct img->SetFrame(2); img->Decode(inFile, 6); w = img->GetWidth(); h = img->GetHeight();
// 4rd page, everything is correct img->SetFrame(3); img->Decode(inFile, 6); w = img->GetWidth(); h = img->GetHeight();
|