Hello all, I have searched all over the net, and tried many different things;
but now I am stumped. I am trying to break multipage tiffs into individual
frames and reformatting them to a different compression style.
The application works great on normal tif files, the problem occurs on some
unusual tif images. For instance: the link provided is an 8 page tif file.
The first 5 pages convert just fine, but pages 6 though 8 throw a Generic
GDI+ exception on the SelectActiveFrame method of the image object. Part of
the problem could be that pages 1-5 are 1bit and pages 6-8 are 8 bit.
I threw together some simple code to demonstrate the issue. I would
appreciate any help. If I can get out the individual pages, I can build the
encoders and handle the process of building a new multipage, this code was
simplified to make it easier to get some help.
Thanks, Dan
//using System.Drawing;
//using System.Drawing.Imaging;
//code start
Image inImg;
inImg = Image.FromFile(@"C:\dlbtemp\F32044996.tif");
for (int i = 0; i < inImg.GetFrameCount(FrameDimension.Page); i++)
{
inImg.SelectActiveFrame(FrameDimension.Page, i);
inImg.Save(@"C:\dlbtemp\F32044996_" + i.ToString() + ".tif",
ImageFormat.Tiff);
}
//code end
//example image: http://www.dbpic.com/pub/F32044996.tif