NoDecodeDelegateForThisImageFormat exception

Aug 12, 2015 at 11:59 AM
Edited Aug 12, 2015 at 12:02 PM
Hello
there is a pretty simple code:
public static void ReadImageFromEmptyBitmap()
{
    using (MagickImage image = new MagickImage(new Bitmap(400, 600, PixelFormat.Format24bppRgb)))
    {
    }

    using (MagickImage image = new MagickImage(new Bitmap(400, 400, PixelFormat.Format24bppRgb)))
    {
    }
}
it works, but if I made simple change at the first line it throws exception:
public static void ReadImageFromEmptyBitmap()
{
    // changed height to 400, exception in the next line
    using (MagickImage image = new MagickImage(new Bitmap(400, 400, PixelFormat.Format24bppRgb)))
    {
    }

    using (MagickImage image = new MagickImage(new Bitmap(400, 400, PixelFormat.Format24bppRgb)))
    {
    }
}
Exception:
ImageMagick.MagickMissingDelegateErrorException was unhandled
  HResult=-2146233088
  Message=Magick.Net.Example.vshost.exe: NoDecodeDelegateForThisImageFormat `XWD' @ error/blob.c/BlobToImage/352
  Source=Magick.NET.Wrapper-x86
  StackTrace:
       at ImageMagick.Wrapper.MagickImage.HandleException(MagickException exception)
       at ImageMagick.Wrapper.MagickImage.Read(Stream stream, MagickReadSettings readSettings)
       at ImageMagick.MagickImage.Read(Stream stream, MagickReadSettings readSettings)
       at ImageMagick.MagickImage.Read(Stream stream)
       at ImageMagick.MagickImage.Read(Bitmap bitmap)
       at ImageMagick.MagickImage..ctor(Bitmap bitmap)
...
  InnerException: 
Is it a bug in ImageMagick?
Coordinator
Aug 12, 2015 at 2:14 PM
I am suspecting that ImageMagick detects the file as an XWD file instead of a BMP file. Not sure why though, will check this out for you later this week/weekend.
Coordinator
Aug 13, 2015 at 11:04 AM
This is indeed a bug in the detection of the format. I have just submitted a patch to the GIT repository of ImageMagick to fix this. So this means it will be fixed in the next release of Magick.NET (7.0.0.0018).
Aug 13, 2015 at 6:07 PM
Thanks!
Aug 14, 2015 at 5:45 AM
dlemstra wrote:
I have just submitted a patch to the GIT repository of ImageMagick to fix this.
Is it possible to get this patch earlier that the next build of Magick.NET will be released?
Can I download it using script ImageMagick\Source\Checkout.cmd?

I'm trying to reach the subversion repository of ImageMagick at https://subversion.imagemagick.org/subversion to check the commit logs
but it returns 500 Internal Server Error: could not open the requested SVN filesystem.
Coordinator
Aug 14, 2015 at 6:44 AM
We switched from SVN to GIT last weekend but I did not change my Checkout script yet. I will do that later today.
Aug 14, 2015 at 7:05 AM
Can you provide a link to the new GIT repository?
Coordinator
Aug 14, 2015 at 7:10 AM
You can find the repository here: http://git.imagemagick.org/
Aug 17, 2015 at 1:41 PM
Thanks!
Coordinator
Aug 17, 2015 at 1:42 PM
Edited Aug 17, 2015 at 2:45 PM
If you 'pull' the latest version of Magick.NET you can run Checkout.cmd again.