<html>
<head>
<base href="https://bugs.webkit.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841"
href="https://bugs.webkit.org/show_bug.cgi?id=168425#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841"
href="https://bugs.webkit.org/show_bug.cgi?id=168425">bug 168425</a>
from <span class="vcard"><a class="email" href="mailto:sabouhallawa@apple.com" title="Said Abou-Hallawa <sabouhallawa@apple.com>"> <span class="fn">Said Abou-Hallawa</span></a>
</span></b>
<pre>Yes, you are right regarding the PNGImageDecoder::repetitionCount(). This function should return RepetitionCountInfinite if the loopCunt is zero. Otherwise it should return the loopCount.
Regarding calculating the premultiplied components, if you look at <a href="https://bugs.webkit.org/attachment.cgi?id=288626&action=review">https://bugs.webkit.org/attachment.cgi?id=288626&action=review</a> you can see the old implementation of the following functions are using different methods for dividing by 255 and they handle the decimal part of the division differently.
premultipliedARGBFromColor()
ImageDecoder::setRGBA()
ImageDecoder::overRGBA()
premultipliedARGBFromColor() was getting the ceiling of the division and this is why there was 254 in the calculations. But ImageDecoder::setRGBA() and ImageDecoder::overRGBA() were just getting the floor of the division.
static_cast<int>((x + 254) / 255.0) will give the ceiling but static_cast<int>(x / 255.0) will get you the floor.
I was just trying to unify the code and remove the duplicates. But it is up to you, you can either change the expected results to match the new calculation. Or you can add an argument to premultipliedChannel(..., bool ceiling = true) and pass it all the way from ImageDecoder to this function.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>