JDK-8167675 : Animated gifs are not working
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u102,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-10-13
  • Updated: 2020-01-31
  • Resolved: 2016-11-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u131Fixed 9Fixed
Description
FULL PRODUCT VERSION :
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]java --ver

A DESCRIPTION OF THE PROBLEM :
If you load a page that contains animated gifs into WebView only static images would be shown.

REGRESSION.  Last worked in version 8u91

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run a javafx app that displays WebView with a page that contains an animiated gif image.



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Gif image at http://forum.awd.ru/download/file.php?avatar=16743.gif is an animated crocodile
ACTUAL -
WebView displays a static image. Probably only first frame of gif is shown.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package test;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class HelloWorld extends Application
{

    @Override
    public void start( Stage primaryStage )
    {
        Pane root = new VBox();

        WebView web = new WebView();
        web.getEngine().load( "http://forum.awd.ru/download/file.php?avatar=16743.gif" );
        root.getChildren().add( web );

        Scene scene = new Scene( root, 300, 250 );

        primaryStage.setTitle( "Hello World!" );
        primaryStage.setScene( scene );
        primaryStage.show();
    }

    public static void main( String[] args )
    {
        launch( args );
    }
}
---------- END SOURCE ----------


Comments
hangeset: a09572cdcb09 user: arajkumar date: Thu Nov 17 12:01:07 2016 +0530 files: modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCImageDecoderImpl.java description: 8167675: Animated gifs are not working Reviewed-by: mbilla, kcr URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/a09572cdcb09
17-11-2016

+1
16-11-2016

+1
15-11-2016

Thanks [~kcr], [~mbilla] Incorporated [~kcr]'s review comment in http://cr.openjdk.java.net/~arajkumar/8167675/webrev.01 Please take a look.
14-11-2016

+1 pending the code style change
11-11-2016

+ if (fullDataReceived) + getImageFrame(0); This does not match our coding standard. Please either surround the statement with curly braces or move it onto the same line as the "if".
11-11-2016

+1
11-11-2016

http://cr.openjdk.java.net/~arajkumar/8167675/webrev
10-11-2016

As mentioned in the comment, the reason for calling getImageFrame(0) is to force the decoding which in turn sets the frameCount after decoding all image frames. So there is no use of storing the return value. No, it is not possible to write a unit test, thats why the bug is marked as noreg-hard.
10-11-2016

Regarding below code, if (fullDataReceived) getImageFrame(0); Function getImageFrame() returns ImageFrame. Can you store the return value? Also is it possible to write a test case to check for framecount for GIF? Can you paste webrev url in this issue...
10-11-2016

framesCount is not properly updated for GIF images after partial decoding(JDK-8153148). It is a regression of JDK-8153148.
09-11-2016

Checked this issue for 8,8u101,8u102,8u112ea,9ea on Windows 7 and could confirm the issue as reported by the submitter. Steps to reproduce: ******************* - Run the attached test program(HelloWorld.java) with JDK. Result: ********* OS : Microsoft Windows 7 [Version 6.1.7601] 64 bit JDK: ++++ 8 b132 : Pass 8u101 b52 : Pass >> 8u102 b14 : Fail <<==== introduced version 8u112 b04 : Fail 9ea b133 : Fail ===============================================================
13-10-2016