Fix convert-to-NIA stillImage check
For example, this GIF image:
https://github.com/google/wuffs/blob/e44920d/test/data/artificial-gif/pixel-data-too-much-bad-lzw.gif
which is 'disassembled' here:
https://github.com/google/wuffs/blob/e44920d/test/data/artificial-gif/pixel-data-too-much-bad-lzw.gif.make-artificial.txt
only has one frame, regardless of how the GIF codec implementation deals
with the LZW-compression error. It is not an animated image.
Nonetheless, frameInfos.size() returns 1, not 0, so prior to this
commit, "stillImage = frameInfos.empty()" assigned false, not true.
See also this Wuffs (not Skia) commit:
3a9933f2a0
Bug: None
Change-Id: Ia69a486abe5c2caa7488c55a37c403e7660ff168
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475436
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This commit is contained in:
parent
b1f450bb2b
commit
8c6df8cd99
@ -152,10 +152,8 @@ int main(int argc, char** argv) {
|
||||
SkDebugf("No frames.\n");
|
||||
return 1;
|
||||
}
|
||||
// The SkCodec::getFrameInfo comment says that this vector will be empty
|
||||
// for still (not animated) images, even though frameCount should be 1.
|
||||
std::vector<SkCodec::FrameInfo> frameInfos = codec->getFrameInfo();
|
||||
bool stillImage = frameInfos.empty();
|
||||
bool stillImage = frameInfos.size() <= 1;
|
||||
|
||||
for (int i = 0; i < frameCount; i++) {
|
||||
SkCodec::Options opts;
|
||||
|
Loading…
Reference in New Issue
Block a user