mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 12:28:26 +01:00
WebPEncode: Support encoding same pic twice (even if modified)
This wasn't working for this specific scenario: - Encode an RGBA 'pic' (with trivial alpha) using lossy encoding. (so that pic->a == NULL after import happens). - Modify the 'pic->argb' so that it has non-trivial alpha. - Encode the same 'pic' again. This used to fail to encode alpha data as pic->a == NULL. Change-Id: Ieaaa7bd09825c42f54fbd99e6781d98f0b19cc0c
This commit is contained in:
parent
54f2c14cce
commit
e4f4dddba3
@ -326,7 +326,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
|
|||||||
|
|
||||||
if (!config->lossless) {
|
if (!config->lossless) {
|
||||||
VP8Encoder* enc = NULL;
|
VP8Encoder* enc = NULL;
|
||||||
if (pic->y == NULL || pic->u == NULL || pic->v == NULL) {
|
if (pic->use_argb || pic->y == NULL || pic->u == NULL || pic->v == NULL) {
|
||||||
// Make sure we have YUVA samples.
|
// Make sure we have YUVA samples.
|
||||||
if (config->preprocessing & 4) {
|
if (config->preprocessing & 4) {
|
||||||
if (!WebPPictureSmartARGBToYUVA(pic)) {
|
if (!WebPPictureSmartARGBToYUVA(pic)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user