Magick.net: Application crashes as soon as resizing the image

Created on 2 Nov 2018  路  2Comments  路  Source: dlemstra/Magick.NET

Prerequisites

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

Description

Hello, I am currently trying to resize the image but my .NET Console Application crashes as soon as it tries to resize. The bytes from the image are fine, because without the Resize() it shows up in the image.

Steps to Reproduce

Calling the own Watermark method

Watermark(teamAImage, 330, 330, image, 530, 530);

Method where I try to resize the image

private static void Watermark(byte[] bytes, int xPosition, int yPosition, IMagickImage image, int? width = null, int? height = null)
{
    using (var watermark = new MagickImage(bytes))
    {
        if (width != null && height != null)
        {
            watermark.Resize((int)width, (int)height);
        }
        watermark.Format = MagickFormat.Png;

        image.Composite(watermark, xPosition, yPosition, CompositeOperator.Over);
    }
}

System Configuration

  • Magick.NET version: Magick.NET-Q8-AnyCPU 7.9.0.1
  • Environment (Operating system, version and so on): Windows 10
  • Additional information: I test the application locally (Windows 10) and it will be on a server later on (Linux Ubuntu 18.04)
    Output:
The program '[23516] dotnet.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
The program '[23516] dotnet.exe: Program Trace' has exited with code 0 (0x0).

Most helpful comment

I suspect you are getting this exception because of a video card driver issue. What kind of video card do you have and is your issues resolved when you upgrade the driver for it? If the problem persists you can disable GPU acceleration with OpenCL.IsEnabled=false.

All 2 comments

I suspect you are getting this exception because of a video card driver issue. What kind of video card do you have and is your issues resolved when you upgrade the driver for it? If the problem persists you can disable GPU acceleration with OpenCL.IsEnabled=false.

I've got the NVIDIA GeForce GTX 760 and it's already up to date.
The problem is solved now with your idea OpenCL.IsEnabled=false.

Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings