Issue 519 in webp: WebPDecodeRGBA does not work on specific image types.

11 views
Skip to first unread message

never… via monorail

unread,
Apr 30, 2021, 7:30:00 PMApr 30
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 519 by never...@gmail.com: WebPDecodeRGBA does not work on specific image types.
https://bugs.chromium.org/p/webp/issues/detail?id=519

What steps will reproduce the problem?
1. Create a 512x512 rgba PNG image filled with one color (I choose black [0, 0, 0, 255])
2. use dwebp to convert to webp format using the -lossless flag (I don't think the flag matters, not sure)
3. in a c++ script, pull in the data and run "webpData = WebPDecodeRGBA(data, length, &width, &height);"

What is the expected output? What do you see instead?

I expect 512x512x4 bytes in the rgba format. Instead the result is 1 width, 1 height, and null return for webpData.

What version of the product are you using? On what operating system?
1.2.0
Both Ubuntu and MacOS return the same result


Please provide any additional information below.

WebPDecoderConfig config;
WebPDecBuffer* const output_buffer = &config.output;
WebPBitstreamFeatures* const bitstream = &config.input;
WebPInitDecoderConfig(&config);
VP8StatusCode get_features_status = WebPGetFeatures(data, length, &config.input);
output_buffer->colorspace = MODE_RGBA;
VP8StatusCode status = WebPDecode(data, length, &config);

from tests, I broke apart the steps, get_features_status returns 0 and status returns a 3.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

never… via monorail

unread,
Apr 30, 2021, 11:28:27 PMApr 30
to webp-d...@webmproject.org

Comment #1 on issue 519 by never...@gmail.com: WebPDecodeRGBA does not work on specific image types.
https://bugs.chromium.org/p/webp/issues/detail?id=519#c1

I found the solution from a lot of experimentation:

The real problem is the size of the buffer, if the buffer is less than a certain amount, the algorithm fails. I padded the image buffer with a bunch of 0s and the algorithm worked again.

pasca… via monorail

unread,
May 1, 2021, 2:13:08 AMMay 1
to webp-d...@webmproject.org

Comment #2 on issue 519 by pasca...@gmail.com: WebPDecodeRGBA does not work on specific image types.
https://bugs.chromium.org/p/webp/issues/detail?id=519#c2

Could you please attach the bitstream, so we can reproduce exactly the problem?

Thanks!

jz… via monorail

unread,
Jul 3, 2021, 2:12:51 PMJul 3
to webp-d...@webmproject.org
Updates:
Labels: Needs-Feedback

Comment #3 on issue 519 by jz...@google.com: WebPDecodeRGBA does not work on specific image types.
https://bugs.chromium.org/p/webp/issues/detail?id=519#c3

I tried to reproduce this with a source of:
$ convert -size 512x512 xc:#000000ff black.png
at v1.2.0 and after the palette change was in [1] without any failures using WebPDecode as in the original post and WebPDecodeRGBA (images sizes were 52 and 30 bytes).

Do you still have the source file that was causing issues?

[1] https://chromium.googlesource.com/webm/libwebp/+/b6513fbaa8a3e21d1d726f6c63bbfa76f157b9a2
Reply all
Reply to author
Forward
0 new messages