-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.1
-
None
-
generic
-
generic
Currently the ImageObserver interface has 2 constants to provide information about
the framing of images. FRAMEBITS is sent as each frame of an animation is
complete. And ALLBITS is sent when all the pixels of an image have been delivered,
whether that be because it was a static image and the first and only frame is done,
or whether that be because it was a looping animation and the last frame is done.
Observer implementations like the MediaTracker tend to be conservative and remove
themselves as observers when the first FRAMEBITS is sent because otherwise they
would keep animated images looping forever. But, in the case of an animated GIF,
it may make sense to allow all frames to be loaded before removing interest so
that they can be cached for future use without having to reload them. Unfortunately,
there is no way to know if the FRAMEBITS is one of an infinite number of unique
frames, or if it is one frame in a loop of a small number of repeating frames.
Two new constants could be added to indicate that a FRAMEBITS represents one of a
small number of repeating frames and perhaps a second to indicate when the last
FRAME has been sent. Suggestions for the names might be "LOOPFRAME" and "LASTFRAME".
"LASTFRAME" would be distinguished from "ALLBITS" in that it would not indicate
that no more frames are coming, but instead that no more "unique" frames were
coming.
the framing of images. FRAMEBITS is sent as each frame of an animation is
complete. And ALLBITS is sent when all the pixels of an image have been delivered,
whether that be because it was a static image and the first and only frame is done,
or whether that be because it was a looping animation and the last frame is done.
Observer implementations like the MediaTracker tend to be conservative and remove
themselves as observers when the first FRAMEBITS is sent because otherwise they
would keep animated images looping forever. But, in the case of an animated GIF,
it may make sense to allow all frames to be loaded before removing interest so
that they can be cached for future use without having to reload them. Unfortunately,
there is no way to know if the FRAMEBITS is one of an infinite number of unique
frames, or if it is one frame in a loop of a small number of repeating frames.
Two new constants could be added to indicate that a FRAMEBITS represents one of a
small number of repeating frames and perhaps a second to indicate when the last
FRAME has been sent. Suggestions for the names might be "LOOPFRAME" and "LASTFRAME".
"LASTFRAME" would be distinguished from "ALLBITS" in that it would not indicate
that no more frames are coming, but instead that no more "unique" frames were
coming.
- relates to
-
JDK-4238335 animated image is refetched if all observes abandon it
- Open
-
JDK-6176679 Application freezes when copying an animated gif image to the system clipboard
- Resolved
-
JDK-6369066 GIF images with loop tag and one single frame should not be animated
- Open