Skip to content

ImageSharp "Does not support this kind of bitmap files" #735

Closed

Description

@wc-matteo

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

Trying to open a specific bitmap file created with Magick.NET fails with an exception. Other files created in the same way don't.

Selecting ImageMagick.MagickFormat.Bmp2 or ImageMagick.MagickFormat.Bmp3 resolves the issue. The issue is with ImageMagick.MagickFormat.Bmp specifically, which uses, according to the docs, version 4 of the format.

The image in question does open without issues in other Windows programs (Paint, Photos, Photoshop) and Dropbox.

Steps to Reproduce

Download the file.

Try to open it:

using (var image = Image.Load("bitmap.bmp"))
{}

generates

Exception has occurred: CLR/System.NotSupportedException
An unhandled exception of type 'System.NotSupportedException' occurred in SixLabors.ImageSharp.dll: 'Does not support this kind of bitmap files.'
   at SixLabors.ImageSharp.Formats.Bmp.BmpDecoderCore.Decode[TPixel](Stream stream)
   at SixLabors.ImageSharp.Image.Decode[TPixel](Stream stream, Configuration config)
   at SixLabors.ImageSharp.Image.WithSeekableStream[T](Configuration config, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, String path)

System Configuration

  • ImageSharp version: 1.0.0-beta0005
  • Environment (Operating system, version and so on): Windows 10 x64 1803
  • .NET Framework version: 4.7.2 / .NET Core 2.1.4

Activity

  1. JimBobSquarePants commented on Oct 11, 2018

    @JimBobSquarePants
    Member

    @wc-matteo

    Yeah, bitmap support covers the more common types so far. @dlemstra Is there code we can use as inspiration from ImageMagick?

  2. dlemstra commented on Oct 12, 2018

    @dlemstra
    Member

    I think we should be able to add support for this. And the file coders/bmp.c could give some insight on how this is done in ImageMagick.

  3. JimBobSquarePants commented on Oct 12, 2018

    @JimBobSquarePants
    Member

    That's good news! 🎉

  4. JimBobSquarePants commented on Nov 23, 2018

    @JimBobSquarePants
    Member

    If we update the support listed in #320 we can fix this

  5. brianpopow commented on Dec 15, 2018

    @brianpopow
    Collaborator

    @wc-matteo: would you mind sharing the image here again? The drop box link does not work anymore. Just attaching it to this ticket would be helpful to reproduce it.

  6. wc-matteo commented on Dec 17, 2018

    @wc-matteo
    Author

    @brianpopow fixed the link. Don't know what happened there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions