Imagesharp: Cannot load 48 bpp PNG (Bit depth is not supported or not valid)

Created on 14 Jun 2017  路  2Comments  路  Source: SixLabors/ImageSharp

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] 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
  • [x] I have searched open and closed issues to ensure it has not already been reported

Description


I am trying to load valid PNG file with 48 bpp

Steps to Reproduce


Simple code that leads to System.NotSupportedException "Bit depth is not supported or not valid.":

Image.Load(File.ReadAllBytes("image.png"));

Stacktrace:

   at ImageSharp.Formats.PngDecoderCore.ValidateHeader()
   at ImageSharp.Formats.PngDecoderCore.Decode[TPixel](Stream stream)
   at ImageSharp.Formats.PngDecoder.Decode[TPixel](Configuration configuration, Stream stream, IDecoderOptions options)
   at ImageSharp.Image.Decode[TPixel](Stream stream, IDecoderOptions options, Configuration config)
   at ImageSharp.Image.Load[TPixel](Configuration config, Stream stream, IDecoderOptions options)
   at ImageSharp.Image.Load[TPixel](Configuration config, Byte[] data, IDecoderOptions options)
   at ConsoleApp1.Program.Main(String[] args) in c:\users\user\documents\Projects\ConsoleApp\Program.cs:line 14

Image to reproduce bug:

image

System Configuration

  • ImageSharp version: 1.0.0-alpha9-00139
  • Environment: Windows 10 Enterprise Version 1703 Build 15063.332
  • .NET Framework version: netcoreapp1.1
  • Visual Studio Professional 2017 Version 15.2 (26430.13)
  • dotnet --info output:
.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.4
png help needed

Most helpful comment

@xakep139 That should do it 馃槃

All 2 comments

Yeah, we don't support 48bpp png yet... Something to definitely look into.

@xakep139 That should do it 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcpabst picture marcpabst  路  3Comments

vinhhrv picture vinhhrv  路  3Comments

devedse picture devedse  路  3Comments

agoretsky picture agoretsky  路  4Comments

olivif picture olivif  路  3Comments