Reading TIFF CCITT Group 4 (scanned or faxed) images with MagickImage in C# throws MagickCoderErrorException. The exception message is shown below:
Magick:: Null count for "Tag 32934" (type 4, writecount -3, passcount 1).
'_TIFFVSetField' @ error/tiff.c/TIFFErrors/563
If the TIFF image is decompressed first, then the reading works fine. Anyone came across this error before and any suggestions on how to resolve this?
Thanks,
Sam
Comments: ** Comment from web user: Sthao **
Magick:: Null count for "Tag 32934" (type 4, writecount -3, passcount 1).
'_TIFFVSetField' @ error/tiff.c/TIFFErrors/563
If the TIFF image is decompressed first, then the reading works fine. Anyone came across this error before and any suggestions on how to resolve this?
Thanks,
Sam
Comments: ** Comment from web user: Sthao **
By the way, here is the code snippet:
--------------------
MemoryStream outputStream = new MemoryStream();
MagickReadSettings readSettings = new MagickReadSettings();
readSettings.Format = MagickFormat.Tiff;
using (MagickImage image = new MagickImage(inputStream, readSettings))
{
image.Format = MagickFormat.Jpeg;
image.Write(outputStream);
outputStream.Seek(0, SeekOrigin.Begin);
}
---------------
The exception goth thrown when instantiating MagickImage on the using statement. Both the bad and good image attached. The goodImage.tif was unzipped from the badImage.tif.
Thanks!