Page 1 of 1

Magick.net crashes but doesn't throw any errors in Windows

Posted: 2019-07-14T19:27:35-07:00
by oceanthrsty
I'm using Magick.Net Q8 X64 7.10.1

Pretty simple little program. Take a higher res image. (2-5MB). Rotate the image, Create a preview size of it 600px x 600px, then create a thumbnail size of it. Do this again and again.

I am building the program in VS2013 in Windows 7 64bit on a VMware machine. Runs fine. I'm able to loop through hundreds of images.

But when I run the program on a full Windows 7 64bit machine I get a black screen. No error message, no memory issue, no BSOD, just completely goes black. Then I have to reboot the machine.

I know the first couple lines of the code runs because it creates the directories. But as soon as it gets to the magick.net part, I think that's when it dies.

I initially thought it was because I was testing on 300 images at a time. But it crashes just as hard on 1 image.

Code: Select all

foreach (var file in d.GetFiles("*.jpg"))
        {
            using (MagickImage image = new MagickImage(file.FullName))
            {
                MagickGeometry sizeThumb = new MagickGeometry(142, 142);
                MagickGeometry sizePreview = new MagickGeometry(600, 600);

                // make sure we respect the aspect ratio
                sizeThumb.IgnoreAspectRatio = false;
                sizePreview.IgnoreAspectRatio = false;

                //rotate the image right way up
                image.AutoOrient();

                //resize for preview & write it
                image.Resize(sizePreview);
                image.Write(previewPath + file.Name);

                //resize for thumb & write it
                image.Resize(sizeThumb);
                image.Write(thumbPath + file.Name);

                //dispose of the image from memory  
                image.Dispose();
                i++;
                Console.WriteLine(i);
            }
        }

Re: Magick.net crashes but doesn't throw any errors in Windows

Posted: 2019-07-15T06:42:41-07:00
by snibgo
Do you rebuild the program on your second machine, or are you simply copying the exe from the first machine?

Re: Magick.net crashes but doesn't throw any errors in Windows

Posted: 2019-07-15T08:03:56-07:00
by oceanthrsty
Just copying the exe, DLLs, etc. I don’t have VS on the machine I’m actually using in production.

The same I do for all the projects I’ve ever built.

Re: Magick.net crashes but doesn't throw any errors in Windows

Posted: 2019-07-16T22:34:09-07:00
by dlemstra
This looks like an OpenCL issue. Can you try to disable it? ( OpenCL.IsEnabled=false;)