JDK-6529743 : new ImageObserver flag constants to indicate when an animation has a fixed set of frames
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.1
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2007-03-01
  • Updated: 2014-03-18
Related Reports
Relates :  
Relates :  
Description
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.

Comments
Please re-open if - if fix is in progress or on the plan to fix soon - if this is a P3 (file as P3, not P4)
18-03-2014