Merge pull request #2131 from dreampiggy/fix_progressive_webp_decoding
Fix progressive WebP decoding by creating data provider with actual data size
This commit is contained in:
commit
df7ed34c14
|
@ -169,8 +169,9 @@
|
||||||
// last_y may be 0, means no enough bitmap data to decode, ignore this
|
// last_y may be 0, means no enough bitmap data to decode, ignore this
|
||||||
if (width + height > 0 && last_y > 0 && height >= last_y) {
|
if (width + height > 0 && last_y > 0 && height >= last_y) {
|
||||||
// Construct a UIImage from the decoded RGBA value array
|
// Construct a UIImage from the decoded RGBA value array
|
||||||
|
size_t rgbaSize = last_y * stride;
|
||||||
CGDataProviderRef provider =
|
CGDataProviderRef provider =
|
||||||
CGDataProviderCreateWithData(NULL, rgba, 0, NULL);
|
CGDataProviderCreateWithData(NULL, rgba, rgbaSize, NULL);
|
||||||
CGColorSpaceRef colorSpaceRef = SDCGColorSpaceGetDeviceRGB();
|
CGColorSpaceRef colorSpaceRef = SDCGColorSpaceGetDeviceRGB();
|
||||||
|
|
||||||
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast;
|
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast;
|
||||||
|
|
Loading…
Reference in New Issue