Open MichaelLogutov opened 5 months ago
Is there any way I can diagnose that kind of problems and maybe direct bug to skia?
Skia is pretty secretive about the errors, but maybe you can try reading the file and properties using SKCodec
. If that reads, then try reading the pixel data and see if it fails.
Also, is it possible to attach the image in a zip file? GitHub process images and usually changes metadata which may be important.
Can you also try SKImage? I wonder if there is something bad with bitmap.
Tried with SKCodec with this:
using var codec = SKCodec.Create(@"c:\Temp\temp.png");
if (codec is null)
Console.WriteLine("Failed to get codec for image");
else
Console.WriteLine("GetPixels = {0}", codec.GetPixels(out _));
Result:
GetPixels = ErrorInInput
Here is image in zip: temp.zip
Can you also try SKImage? I wonder if there is something bad with bitmap.
You mean SKImage.FromBitmap
?
The PNG above contains a CRC mismatch in the IEND chunk. Does Skia expose options for determining whether validation is required?
@JimBobSquarePants good question. It seems that skia in chrome browser somehow ignores CRC mismatch, so maybe there is a way.
Btw, how did you managed to find about CRC mismatch?
Btw, how did you managed to find about CRC mismatch?
I used ImageSharp 😉
Description
I've noticed that we have some decode issues in our app with some PNG images. For example this one:
It's loading fine in OS (Windows 11), but consistently failed to be loaded with
SKBitmap.Decode
(it returns null).I've tried
3.0.0-preview.3.1
version and2.88.8
. This issue exists both on Windows 11 and in Linux containers with NET 8.Code
Expected Behavior
Image loaded successfully.
Actual Behavior
SKBitmap.Decode
returns null.Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Other (Please indicate in the description)
Platform / Operating System
Linux, Windows
Platform / Operating System Version
Windows 11
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct