Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Unhandled exception System.BagImageFormatException

$
0
0
Been banging my head on this all afternoon. I was successfully able to get the 64bit version up and running in an Windows Form earlier in the day. Now I've started a new project, added the x64 DLL as a resource. And it errors every time.
"An unhandled exception of type 'System.BagImageFormatException' occurred in System.dll"
"Additional Information: Could not load file or assembly 'Magick.NET-x64..."

The only thing that's different is now I'm using a FileSystemWatcher. So is it because of the threading that magick.net cannot load?

I've tried setting the build of the program to x64 and x86 and tried both DLLs.
private void eventRaised(object sender, System.IO.FileSystemEventArgs e)
        {
            switch (e.ChangeType)
            {
                case WatcherChangeTypes.Created:
                 //   createComposite(e.FullPath);
                    string newFile = e.FullPath;
                    using (MagickImageCollection images = new MagickImageCollection())
                    {
                        //add the 1st image
                        MagickImage image = new MagickImage(newFile);
                        images.Add(image);

                        string appPath = Path.GetDirectoryName(Application.ExecutablePath);

                        //add the background
                        MagickImage background = new MagickImage(Path.Combine(appPath, "ripkenbg.jpg"));
                        images.Add(background);

                        //do the composite and write over the image
                        image.Composite(image, Gravity.Center);
                        image.Write(string.Format(@"c:\workspace\HFPoutput\{0}", Path.GetFileName(newFile)));
                    }
                    StatusUpdate(string.Format("File {0} has been created\r\n", e.FullPath));

                    break;
                default: // Another action
                    break;
            }
        }
Thanks

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>