xamarin / XamarinComponents

Plugins for Xamarin
MIT License
1.99k stars 693 forks source link

Xamarin.SDWebImage : SetImage() - CGImageCreate: invalid image byte order info for bitsPerPixel #1405

Open atokuswanto opened 2 years ago

atokuswanto commented 2 years ago

Environment

Code On iOS 16, some images couldn't be loaded from url.

imageView.SetImage(url)

Same code with same image works well on iOS 15.

Error CGImageCreate: invalid image byte order info for bitsPerPixel != 32 = 16384

AnthonyDunk commented 1 year ago

I had the same issue, but using OpenCV's CvVideoCamera for live video processing. Worked fine on iOS 15, failed on iOS 16 with the same message as you're getting.

In my case it was because I had only 3 channels in my image, instead of 4. So I added the alpha channel, and that got rid of the error.

aiemsal commented 1 year ago

I have the same problem since IOS 16 update, seems like a fix was done in the native library. For the moment I disabled webp with SDWebImageManager.SharedManager.ImageDownloader.SetHttpHeaderValue("image/jpeg,image/png;q=0.8", "accept");

atokuswanto commented 1 year ago

@aiemsal your fix was life saver. It works like a charm.