Skiasharp: [BUG] SKImage.FromEncodedData(String) returns image with broken alpha on GPU backend

Created on 6 Dec 2019  路  3Comments  路  Source: mono/SkiaSharp

Description

We are using 1.68.1 and see that SKImage.FromEncodedData(String) loads PNG images with broken alpha when drawn on GPU backend.

Code

using (var image = SKImage.FromEncodedData(path))
{
   canvas.DrawImage(image, new SKPoint(400.0f, 100.0f));
}

Expected & Actual Behavior

image

Basic Information

  • Version with issue: 1.68.0, 1.68.1
  • IDE: Visual Studio
  • Platform Target Frameworks:

    • Windows Classic: Windows10

  • Target Devices:

    • Desktop

Reproduction Link

SkiaApp.zip

type-bug

Most helpful comment

Thanks for the issue. I got a fix building and it will be in the 1.68.1.1 release.

All 3 comments

This is not the only overload with this behavior. I've faced the same issue with Stream overload if I am remember it correctly. Fixed it by using of another overload.

I'll have a look and see what I can find out. Maybe something is broken in the decoder that is not using the correct alpha from the file - but - it works in raster...

Thanks for the issue. I got a fix building and it will be in the 1.68.1.1 release.

Was this page helpful?
0 / 5 - 0 ratings