Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashed at MagickImage.Write() in Q8 build. #507

Closed
3 tasks done
t246246 opened this issue Aug 20, 2019 · 2 comments
Closed
3 tasks done

Application crashed at MagickImage.Write() in Q8 build. #507

t246246 opened this issue Aug 20, 2019 · 2 comments

Comments

@t246246
Copy link

t246246 commented Aug 20, 2019

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of Magick.NET
  • I have searched open and closed issues to ensure it has not already been reported

Description

Using Q8 AnyCPU version installed from nuget, sample program crashes at magick.Write(). (It cannot be caught even adding [HandleProcessCorruptedStateExceptions])

No problem with Q16 version.

Steps to Reproduce

Save attached file as indexed8.png.

using ImageMagick;
using System;
using System.IO;
using System.Runtime.ExceptionServices;

namespace ConsoleApp1
{
    class Program
    {
        [HandleProcessCorruptedStateExceptions]
        static void Main(string[] args)
        {
            using (var input = new MemoryStream())
            {
                try
                {
                    using (var output = new MemoryStream())
                    {
                        using (var magick = new MagickImage("../../indexed8.png"))
                        {
                            magick.RenderingIntent = RenderingIntent.Perceptual;
                            magick.BlackPointCompensation = true;
                            //if (magick.GetColorProfile() == null)
                            //    magick.AddProfile(ColorProfile.SRGB);
                            //magick.RemoveProfile("icc");
                            magick.ColorSpace = ColorSpace.Gray;
                            magick.ColorAlpha(MagickColors.White);
                            magick.Write(output, MagickFormat.Png00);
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.Out.WriteLine(e.StackTrace);
                }
            }
        }
    }
}

indexed8

System Configuration

  • Magick.NET version: 7.14.2.0 Q8 AnyCPU
  • Environment (Operating system, version and so on): Windows 7 Professional 64 bit (version 6.1 Build 7601: Service Pack 1)
  • Additional information: Visual Studio Enterprise 2017 (version 15.9.15). Compiled with ,NET Framework 4.7
@t246246 t246246 changed the title Application crashed at magick.Write() in Q8 build. Application crashed at MagickImage.Write() in Q8 build. Aug 20, 2019
@dlemstra dlemstra added the bug label Aug 20, 2019
@dlemstra
Copy link
Owner

dlemstra commented Aug 20, 2019

It looks like you found a bug. Not sure what is causing this but I see that something is happening inside our PNG writer. Now I will need to figure out if this is our code or the PNG library.

Edit: Found the problem (in ImageMagick) and now I will need to figure out how to fix this.

@dlemstra dlemstra added this to the 7.14.2.1 milestone Aug 20, 2019
@dlemstra
Copy link
Owner

The bug has been fixed in ImageMagick and I just published a new release that includes this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants