LibGfx: add erroneous cases to GIF test suite

This commit is contained in:
Peter Nelson 2020-11-08 17:34:30 +00:00 committed by Andreas Kling
parent fa57083552
commit cd38fab63f
7 changed files with 36 additions and 0 deletions

View file

@ -140,6 +140,42 @@
<td>Transparent gif with 4 transparent frames, loops forever, restore previous</td>
</tr>
<tr>
<td class="b"><img src="gifsuite_files/animated_transparent_loop_frames_out_of_bounds.gif"></td>
<td class="b"><img src="gifsuite_files/animated_transparent_loop_frames_out_of_bounds-0.png"></td>
<td class="b"><img src="gifsuite_files/animated_transparent_loop_frames_out_of_bounds-1.png"></td>
<td class="b"><img src="gifsuite_files/animated_transparent_loop_frames_out_of_bounds-2.png"></td>
<td class="b"><img src="gifsuite_files/animated_transparent_loop_frames_out_of_bounds-3.png"></td>
<td>
<p><strong>Erroneous test case:</strong> frame out-of-bounds.
The first frame is located at offset (200,0) and so is wholly outside of the bounds of the 100x100 GIF.
The last frame is partially out of bounds, located at (60,60) and of size (50,50).</p>
<p>Note that the GIF specification is unclear on what to do if a frame extends past the logical
screen of the GIF, therefore different renderers behave differently here:</p>
<ul>
<li>Firefox, ImageMagick: don't expand logical screen, render unwritten pixels as transparent
<strong>(this is what the reference frames show)</strong>
<li>Chrome, Edge, IE11: expand logical screen, render unwritten pixels as transparent
<li>Safari: don't expand logical screen, render unwritten pixels as GIF background colour
</ul>
</td>
</tr>
<tr>
<td class="b"><img src="gifsuite_files/bad_lzw_data.gif"></td>
<td class="b">N/A</td>
<td class="b">N/A</td>
<td class="b">N/A</td>
<td class="b">N/A</td>
<td>
<p><strong>Erroneous test case:</strong>. Final frame contains bad LZW data and will fail to decode.
Decoder implementations are not under any obligation to render anything useful here, however they
should fail gracefully and not crash.</p>
</td>
</tr>
</tbody>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB