-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 2.84.0-preview.4: SKCodec.Create - Value cannot be null. Parameter name: buffer #1551
Comments
I did this as a workaround - go through
|
@AndersMad, you've just saved my day! Thank you! |
I've got the same error after upgrading I do not control the calls to Skia as I'm using a library that uses it (i.e. Aspose.Words), so I cannot try to proposed workaround. :/
Could this be related to this PR #1510 |
This null exception also occurs in v2.80.3 on iOS when calling SKBitmap.Decode( stream ). |
We are getting "Value cannot be null" error on Android while creating bitmap.
|
Same error even from SKimage SKBitmap bitMap = SKBitmap.FromImage(SKImage.FromEncodedData(new MemoryStream(mediaFileBytearray))); |
rolled back to previous version 2.80.2 |
Is it possible to attach an image in a zip file? GitHub does some processing and the image is modified. Also, could you give the latest 2.88 preview a try. |
Looks like these are related. Duplicate of #1621 |
Using version 2.88-preview.120 did not solve this issue for me on android. It is working by rolling back to 2.80.2, though. |
sry @mattleibow - I didn't see that zip request, so here's a beautiful girl with data problems for you :) beautiful-girl-1551.zip |
Also got this error after updating to 2.80.3. It seems to happen with all photos taken with Samsung Galaxy 8 phone |
I can confirm. Skisharp is not working with images taken from my Samsung S8 (Other devices have no issue android or iOS)
|
This bug still persists in version 2.88 prev .155 any updates or workarounds? |
For me, the workaround @AndersMad said worked. But my images are now turned 90 degrees. |
Since update from 2.82 to 2.83 have have the same problems with samsung devices. |
thanks for that solution @AndersMad - I ran into this same error with certain images via SKBitmap.Decode(stream): Stream? stream = /*......*/;
var bitmap = SKBitmap.Decode(stream); // NOPE, error!
var image = SKImage.FromBitmap(bitmap);
var outputData = image.Encode(SKEncodedImageFormat.Png, 100); changed to this to fix: Stream? stream = /*......*/;
using var inputStream = new SKManagedStream(stream);
using var inputData = SKData.Create(inputStream);
var bitmap = SKBitmap.Decode(inputData); // now it works
var image = SKImage.FromBitmap(bitmap);
var outputData = image.Encode(SKEncodedImageFormat.Png, 100); |
Any changes on this? Still happening on latest preview |
Yes, still has issue in 2.88.0-preview.232 |
I had the same issue with this photo that I have zipped up that I got from google. I have another if needed as 2 of my 12 testing photos threw this error Stream photoContentStream; // Stream passed in with data, just noting type here for clarity.
using var stream = new SKManagedStream(photoContentStream, false);
SKBitmap? bitmap = SKBitmap.Decode(stream); Solution was this: using var stream = new SKManagedStream(photoContentStream, false);
SKImage img = SKImage.FromEncodedData(stream);
SKBitmap? bitmap = SKBitmap.FromImage(img); Any status on the core reasoning behind this? I am using Version="2.88.0" |
Were you able to fix the 90 deg problem ? |
Also ran into this on iOS and Android in Xamarin.Forms. Doing
Doing @BenjaminMichaelis's suggestion above worked.
Thanks!! |
Use the workaround from mono/SkiaSharp#1551 (comment) to load bitmaps. Fixes #7773
Hi folks. Sorry it took forever to fix this - especially since it was so simple and totally my fault. I will try get a package out ASAP after this merges: #2265 |
Description
Exception "Value cannot be null. Parameter name: buffer" on
SKCodec.Create
- stack:This only happens on a few images - attached one.
Code
Basic Information
Version with issue: 2.84.0-preview.4
Last known good version: 2.84.0-preview.1
IDE: Visual Studio 2019
Platform Target Frameworks: .NETFramework 4.8
Image File Sample
The text was updated successfully, but these errors were encountered: