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

The images in WebP format are not loading or displaying correctly on iOS 15, but they work fine on iOS 17. I haven’t tested on iOS 16 yet. #336

Open
sangampokharel opened this issue Sep 19, 2024 · 2 comments
Labels
apple bug Apple's bug that need workaround

Comments

@sangampokharel
Copy link

sangampokharel commented Sep 19, 2024

Steps to Reproduce:

  1. Run the app on an iOS 15 device but works perfectly in iOS 17
  2. Attempt to load a WebP image using SDWebImageSwiftUI.
  3. Observe that the image does not display as expected.

Expected Behavior:
WebP images should load and display correctly on iOS 15, similar to how they work on iOS 17.

Actual Behavior:
The WebP images are not loading or displaying correctly on iOS 15.

Additional Information:

  • SDWebImageSwiftUI version: 2.2.7
  • iOS version: 15.x
  • WebP images are loading fine on iOS 17.
  • I have not tested on iOS 16 yet.

if let url = URL(string: "https://www.gstatic.com/webp/gallery/1.webp") {

WebImage(url:url)
.resizable()
.placeholder(Image("vendor_background_placeholder"))
.onSuccess { image, data, cacheType in
print("Image successfully loaded")
}
.onFailure(perform: { error in
print("Image loading failed (error.localizedDescription)")
})

}

in ios 17 I am seeing logs "Image loaded successfully" but in ios 15 neither success nor failure log is displayed in console

pod 'SDWebImageSwiftUI'

Please let me know if there are any additional steps I should take or if there are any workarounds available.

Thank you!

@sangampokharel sangampokharel changed the title I’m experiencing issues with WebP image format support when using SDWebImageSwiftUI on iOS 15. The images in WebP format are not loading or displaying correctly on iOS 15, but they work fine on iOS 17. I haven’t tested on iOS 16 yet. The images in WebP format are not loading or displaying correctly on iOS 15, but they work fine on iOS 17. I haven’t tested on iOS 16 yet. Sep 19, 2024
@dreampiggy
Copy link
Collaborator

Anything related to Apple's own decoder (ImageIO framwork), maybe you should ask Apple to fix :)

If not, you can have a try with our custom decoder using libwebp (open-sourced)

https://github.com/SDWebImage/SDWebImageWebPCoder

@dreampiggy
Copy link
Collaborator

dreampiggy commented Sep 19, 2024

Read this link: https://github.com/SDWebImage/SDWebImage?tab=readme-ov-file#supported-image-formats

Apple's system decoder may have different behavior on different firmware OS version, but our third-party based decoder always has the same behavior across any firmware version

@dreampiggy dreampiggy added the apple bug Apple's bug that need workaround label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple bug Apple's bug that need workaround
Projects
None yet
Development

No branches or pull requests

2 participants