Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 531 by zjup...@
gmail.com: some webp images downsample cause distortion and mosaic
https://bugs.chromium.org/p/webp/issues/detail?id=531What steps will reproduce the problem?
1. a webp image at attachment with size 300*300
2. use libwebp to decode as 150*150 image, down sample size = 2
3. show the image/bitmap and it become distortion
What is the expected output? What do you see instead?
the image will show normal as 300*300 image.
What version of the product are you using? On what operating system?
1.2.0 version from
https://github.com/webmproject/libwebp/tree/v1.2.0Please provide any additional information below.
decode the image to 300*300, every thing is ok. libwebp usage in
https://github.com/zjupure/GlideWebpDecoder/blob/master/webp_decoder/src/main/jni/webp.cpp#L540relative issue:
https://github.com/zjupure/GlideWebpDecoder/issues/83usage code as follow, when config.options.use_scaling set to true and scaled_width/scale_height is smaller then original webp width/height
config.options.no_fancy_upsampling = 1;
if (width != spNativeWebPFrame->width || height != spNativeWebPFrame->height) {
config.options.use_scaling = true;
config.options.scaled_width = width;
config.options.scaled_height = height;
}
config.output.colorspace = MODE_rgbA;
config.output.is_external_memory = 1;
config.output.u.RGBA.rgba = pixels;
config.output.u.RGBA.stride = bitmapInfo.stride;
config.output.u.RGBA.size = bitmapInfo.stride * bitmapInfo.height;
ret = WebPDecode(pPayload, payloadSize, &config);
AndroidBitmap_unlockPixels(pEnv, bitmap);
if (ret != VP8_STATUS_OK) {
__android_log_print(ANDROID_LOG_WARN, "GLIDE_WEBP",
"Failed to decode frame, ret=%d", ret);
spNativeWebPFrame.reset();
throwIllegalStateException(pEnv, "Failed to decode frame. VP8StatusCode: %d", ret);
Attachments:
head.webp.zip 1.7 MB
--
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