Problem with Interlace PNG

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
mpower
Posts: 3
Joined: 2016-03-07T13:07:46-07:00
Authentication code: 1151

Problem with Interlace PNG

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Problem with Interlace PNG

Post by dlemstra »

This looks like a bug in Magick.NET. I will investigate this and get back to you when I have more information.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
mpower
Posts: 3
Joined: 2016-03-07T13:07:46-07:00
Authentication code: 1151

Re: Problem with Interlace PNG

Post by mpower »

Sounds good, thanks.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Problem with Interlace PNG

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
mpower
Posts: 3
Joined: 2016-03-07T13:07:46-07:00
Authentication code: 1151

Re: Problem with Interlace PNG

Post by mpower »

Thank you very much.
That's greatly appreciated.

:D
Michael
Post Reply