You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I receive an "improper image header" error message when flattening a multi-layered TIFF image (see below). I then downgraded to v.9.0.0. I re-ran my code, upgraded to the next version, and repeated the process, until I discovered the error is generated in all versions starting at 11.1.0. Another discovery: when there are 2 or more masking channels, the error is triggered, BUT when there is only 1 masking channel, the file flattens successfully. (This might point to where in the code this bug was introduced.)
SOURCE TIFF TEST FILE (file too large to attach here)
This is related to ImageMagick adding support for more channels in the TIFF image format. This broke reading the (PSD) layers and I added a patch to resolve this in the next release of Magick.NET.
Magick.NET version
Magick.NET-Q16-AnyCPU Version 11.10 and up
Environment (Operating system, version and so on)
Windows 10 Pro Version 10.0.19043 Build 19043
Description
I receive an "improper image header" error message when flattening a multi-layered TIFF image (see below). I then downgraded to v.9.0.0. I re-ran my code, upgraded to the next version, and repeated the process, until I discovered the error is generated in all versions starting at 11.1.0. Another discovery: when there are 2 or more masking channels, the error is triggered, BUT when there is only 1 masking channel, the file flattens successfully. (This might point to where in the code this bug was introduced.)
SOURCE TIFF TEST FILE (file too large to attach here)
[https://vrxwestus.blob.core.windows.net/vrxstudios-downloads/layered.tif]
ERROR MESSAGE
ImageMagick.MagickCorruptImageErrorException
$(String[] args) in [path-to-program.cs]:line 10HResult=0x80131500
Message=improper image header
[path-to-tiff-file]' @ error/psd.c/ReadPSDLayersInternal/2021 Source=Magick.NET-Q16-AnyCPU StackTrace: at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadFile(IMagickSettings
1 settings)at ImageMagick.MagickImageCollection..ctor(String fileName)
at Program.
CODE
using (MagickImage img = new MagickImageCollection("[path-to-tiff-file]").Flatten())
{
img.Depth = 8;
img.Settings.Compression = CompressionMethod.LZW;
img.RemoveProfile("8bim");
img.RemoveProfile("psd:additional-info");
img.HasAlpha = false;
img.Label = "Background";
img.Write(Path.Combine([path-to-tiff-file-flattened]));
}
Steps to Reproduce
The text was updated successfully, but these errors were encountered: