Skip to content

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

@wc-matteo

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

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