On Tue, 3 Nov 2026 16:04:43 GMT, Alexey Ivanov <[email protected]> wrote:

> If a GIF image contains one frame and the loop count isn't set to 1, it is 
> still animated.
> 
> The GIF decoder starts the animation thread that decodes the single frame 
> over and over again. The image itself looks static, but decoding consumes CPU 
> and memory.
> 
> The proposed fix stops animating the image if it contains one frame only.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.desktop/share/classes/sun/awt/image/ImageFetcher.java line 241:

> 239:     }
> 240: 
> 241:     /**

This isn't "wrong" and it is an internal method .. but the description perhaps 
could be clearer that it is required that this be called ONLY from an animation 
thread .. not that it goes off and some how finds an animator thread to stop.

And you could just have made the existing private method package visible.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33701#discussion_r4556964915

Reply via email to