RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v6]

Jeremy Wood duke at openjdk.org
Sun Jun 1 07:02:52 UTC 2025


On Tue, 27 May 2025 14:18:13 GMT, Jayathirth D V <jdv at openjdk.org> wrote:

> Also its better if we can actually create test gif file using ImageIO(There are examples in test/jdk/javax/imageio/plugins/gif/) programatically and use it instead of external GIF files for testing.

I wrote a new class GifBuilder that programmatically creates the test gif file; and it can generate test files for some of the other related pending bugs.

> I think we a need a gif with only 2 frames having transpixel>0 and disposal method save to reproduce this scenario.

I think we need 3 frames. The test currently resembles:

    public static void main(String[] args) throws Throwable {
        GifBuilder.test(
                new GifBuilder.FrameDescription(GifBuilder.Disposal.restoreToBackgroundColor, false),
                new GifBuilder.FrameDescription(GifBuilder.Disposal.doNotDispose, false),
                new GifBuilder.FrameDescription(GifBuilder.Disposal.doNotDispose, false) );
    }


If I comment out any one of these three frames then this test passes when I run it against the master branch.

For additional context:
A. This file architecture was reverse engineered from https://free-gifs.org/gif/CC0-3D
B. None of this weekend's changes alter the proposed change in GifImageDecoder ; this is all just refactoring the test

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2926693285


More information about the client-libs-dev mailing list