Product: IEvolution
Version: 4.0.1.0
I am having an issue re-sampling multi-page tiffs. I take a large multipage tiff, break it out into single pages, and then re-merge at a lower resolution. I am getting random failures in the merge section. If I run the same source file multiple times, I get a different page failing each time, and sometimes it will go all the way through.
The equivalent Delphi Code does not have this issue.
I would appreciate any assistance with this, and if there is a more straightforward way of re-sampling the file I would appreciate it. I
have provide the loop portion below
Sincerely
Steve Griffiths
for (int i = 1; i < pageCount; i++)
{
IEImage img = new IEImage(imageFiles[i]);
if (shrink != TiffConstants.DO_NOT_SHRINK)
{
Size size = new Size();
size = CalculateResizeScale(shrink, img, size);
if (!size.IsEmpty)
{
img.Resample(size.Width, -1, IEResampleFilter.Lanczos3);
}
}
img.IOParams.TIFF_ImageIndex = i;
lastCount = imgCount;
imgCount = img.InsertToTIFF(outFile);
img.Dispose();
if (imgCount <= lastCount)
{
throw new Exception(string.Format("Page {0} not added",i));
}
}