Crash on image encoding (WebPPictureImportRGBA)
Hi, I'm using this lib and I have a problem to convert png image on webp. In particular when I try to encode png Data, App crashes on line 1284 if(!WebPPictureImportRGBA(&picture, buffer.data, (int)buffer.rowBytes)) goto fail;
I find a possible solution of problem: analyzing the code I see that variable "lossless" is used to set picture.use_argb, so if you pass NO app crash on png image, if you force YES on YYImageCoder.m - line 2683
CFDataRef frameData = YYCGImageCreateEncodedWebPData(image, YES, _quality, 4, YYImagePresetDefault);
it works.
I suggest to modify the switcher on YYImageCoder (line 2357) in .. case YYImageTypeWebP: { _quality = 0.8; _lossless = YES; } ...
Yes, adding _lossless = YES; solved the issue for me 👏 Thanks for the solution