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.