1

I have a C# program where I'm using Magick.Net Q8 X64 7.10.1

I am building the program in VS2013 in Windows 7 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 machine I get a black screen. No error message, no memory issue, no BSOD, just completely goes black. Where 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.

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);
            }
        }
Matt Winer
  • 495
  • 9
  • 26

1 Answers1

0

Before doing any Magick.Net operations on images (like resize) try to disable the gpu acceleration for this operations by using OpenCL.IsEnabled = false.