Skip to content
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

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

Open
atokuswanto opened this issue Sep 28, 2022 · 3 comments

Comments

@atokuswanto
Copy link

Environment

  • Visual Studio for Mac 2022
  • xCode 14
  • iOS 16

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

@atokuswanto atokuswanto changed the title Xamarin.SDWebImage Xamarin.SDWebImage : SetImage() - CGImageCreate: invalid image byte order info for bitsPerPixel Sep 28, 2022
@AnthonyDunk
Copy link

AnthonyDunk commented Oct 16, 2022

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
Copy link

aiemsal commented Oct 28, 2022

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants