Page 1 of 1

Problem with Interlace PNG

Posted: 2016-03-07T14:10:08-07:00
by mpower
Hi,
I'm using Magick.NET-Q8-AnyCPU.dll to convert PDF to PNG(s), however I am unable to make the PNG interlaced.
Here's my code.

Code: Select all

                MagickReadSettings settings = new MagickReadSettings();
                settings.Density = new PointD(300, 300);

                using (MagickImageCollection miImages = new MagickImageCollection())
                {
                    miImages.Read(Path.Combine(filePath, "file.pdf"), settings);

                    int page = 1;
                    foreach (MagickImage miImage in miImages)
                    {
                        miImage.Scale(image.width + 1, image.width * miImage.Height / miImage.Width);
                        miImage.ColorAlpha(miImage.BackgroundColor);
                        miImage.Interlace = Interlace.Png;
                        miImage.Write(filePath + image.size + "-" + page + ".png");
                        page++;
                    }
                }
I have also tried several settings ("miImage.Interlace = Interlace.Line;" etc ) but the image size never changes, and when I check the metadata with this online tool http://regex.info/exif.cgi it says it is "Noninterlaced"

Thanks in advance
Michael

Re: Problem with Interlace PNG

Posted: 2016-03-08T15:29:29-07:00
by dlemstra
This looks like a bug in Magick.NET. I will investigate this and get back to you when I have more information.

Re: Problem with Interlace PNG

Posted: 2016-03-08T15:43:17-07:00
by mpower
Sounds good, thanks.

Re: Problem with Interlace PNG

Posted: 2016-03-12T02:30:27-07:00
by dlemstra
I just pushed a patch to the GIT repository of Magick.NET to resolve this. The next version of Magick.NET (7.0.0.0104) will include this fix.

Re: Problem with Interlace PNG

Posted: 2016-03-14T08:56:02-07:00
by mpower
Thank you very much.
That's greatly appreciated.

:D
Michael