cwebp: fix WebPPictureHasTransparency call
when near_lossless is < 100; previously the zeroed 'picture' would be
passed in the check rather than the original picture. this would result
in alpha never been kept in the decode.
@@ -1140,8 +1140,9 @@ int main(int argc, const char* argv[]) {
}
picture.use_argb = 1;
- if (!ReadWebP(memory_writer.mem, memory_writer.size, &picture,
- /*keep_alpha=*/WebPPictureHasTransparency(&picture),
+ if (!ReadWebP(
+ memory_writer.mem, memory_writer.size, &picture,
+ /*keep_alpha=*/WebPPictureHasTransparency(&original_picture),
/*metadata=*/NULL)) {
fprintf(stderr, "Error! Cannot decode encoded WebP bitstream\n");
fprintf(stderr, "Error code: %d (%s)\n", picture.error_code,
