Closed dreampiggy closed 5 years ago
From my code contribution for SDWebImage's repo, the code to generate CGImage
in webp_decode.m
is not correct. The channel of bitmap buffer is 3(24bit), but you use the kCGImageAlphaNoneSkipLast
(4 channel, 32bit). See more on: https://github.com/SDWebImage/SDWebImage/pull/2348.
Chaning the code in webp_decode.m:80
from:
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Big | (webp_cfg.input.has_alpha ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNoneSkipLast);
into:
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Big | (webp_cfg.input.has_alpha ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNone);
Can solve the issue.
For macOS 10.14 user, who face the same issue and want a hotfix, you can download my Xcode archive quicklook plugin with the patch #39
qlImageSize version: v2.6 libwebp version: libwebp v1.0.2
Today I'm trying qlImageSize quicklook to view WebP images. The demo image is here: https://www.gstatic.com/webp/gallery/1.webp. But with no success. The quicklook show empty and keep loading.
Since I'm a iOS/macOS developer, I try to debug this quick look plugin by using the https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Articles/QLDebugTest.html
After I running the Xcode in Debug configruation, and view a demo 1.webp, the console output is here: