New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722168 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Discrepancy in frame completion status for static images.

Project Member Reported by khushals...@chromium.org, May 15 2017

Issue description

ImageDecoder::FrameIsCompleteAtIndex[1] is meant to return whether all encoded data for the frame at the queried index has been received. While it returns this value for animated images, for single frame images, it returns true only if a cached decode for the complete image is available. This discrepancy ends up having code in blink::BitmapImage incorrectly assuming that the image has only been partially loaded[2].

Note that this means that for lazily decoded single-frame images, [2] will never be true since the decoder that decodes and caches frames is different from the decoder in DeferredImageDecoder which is used only for parsing the metadata.

[1]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h?l=196
[2]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/graphics/BitmapImage.h?l=125
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d60bb8e8f149732f85716124e05c349b360c333

commit 4d60bb8e8f149732f85716124e05c349b360c333
Author: khushalsagar <khushalsagar@chromium.org>
Date: Tue May 16 03:12:31 2017

blink: Fix frame completion querying for static images.

ImageDecoder::FrameIsCompleteAtIndex is meant to return whether all
encoded data for the frame at the queried index has been received.
While it returns this value for animated images, for single frame
images, it returns true only if a cached decode for the complete image
is available. This discrepancy ends up having code in blink incorrectly
assuming that the image has only been partially loaded.

This change has the decoder return this status for static images based
on whether all data for an image has been received.

BUG= 722168 

Review-Url: https://codereview.chromium.org/2879123003
Cr-Commit-Position: refs/heads/master@{#472000}

[modify] https://crrev.com/4d60bb8e8f149732f85716124e05c349b360c333/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
[modify] https://crrev.com/4d60bb8e8f149732f85716124e05c349b360c333/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
[modify] https://crrev.com/4d60bb8e8f149732f85716124e05c349b360c333/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
[modify] https://crrev.com/4d60bb8e8f149732f85716124e05c349b360c333/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/19d792a377d6854e46acb0fd786b48f0690ad9d1

commit 19d792a377d6854e46acb0fd786b48f0690ad9d1
Author: scroggo <scroggo@chromium.org>
Date: Mon Jul 17 23:52:32 2017

FrameIsCompleteAtIndex to FrameIsReceivedAtIndex

This method actually returns whether the encoded data for the frame at
|index| has been fully received. (Prior to crrev.com/2879123003, the
behavior was different for single-frame images versus multi-frame
images. Now both return whether the frame is received.)

Rename the method to better reflect its use, and avoid confusion in the
future.

No change in behavior, no new tests.

Bug:  722168 
Review-Url: https://codereview.chromium.org/2982083002
Cr-Commit-Position: refs/heads/master@{#487287}

[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/BitmapImage.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/ImageSource.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/ImageSource.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h
[modify] https://crrev.com/19d792a377d6854e46acb0fd786b48f0690ad9d1/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp

Sign in to add a comment