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

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
oceanthrsty
Posts: 9
Joined: 2014-12-17T15:00:32-07:00
Authentication code: 6789

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

Post 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);
            }
        }
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

Do you rebuild the program on your second machine, or are you simply copying the exe from the first machine?
snibgo's IM pages: im.snibgo.com
oceanthrsty
Posts: 9
Joined: 2014-12-17T15:00:32-07:00
Authentication code: 6789

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

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

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

Post by dlemstra »

This looks like an OpenCL issue. Can you try to disable it? ( OpenCL.IsEnabled=false;)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply