Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097455

BMP image fails to load when a specific size is requested

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8u60
    • 8u45
    • javafx
    • None
    • Windows 7 x64

    Description

      The following works fine, displaying the image as it should:


      Image img = new Image("file:x.bmp");

      System.out.println(img.getHeight()); //Actual image height

      StackPane sp = new StackPane();
      sp.getChildren().add(new ImageView(img));
      primaryStage.setScene(new Scene(sp));
      primaryStage.show();


      However, if the image constructor is changed to request a resized image instead:

      Image img = new Image("file:x.bmp", 200, 200, false, false);

      System.out.println(img.getHeight()); //0

      StackPane sp = new StackPane();
      sp.getChildren().add(new ImageView(img));
      primaryStage.setScene(new Scene(sp));
      primaryStage.show();

      ...the image fails to load at all.

      The following bug appears to occur with all BMP files (tried 8 and 24 bit), but the correct behaviour occurs for GIF, PNG and JPG files.

      Attachments

        Activity

          People

            vadim Vadim Pakhnushev
            mberryjfx Michael Berry (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: