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

ImageLoader doesn't report metadata for a BMP image

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Labels:
    • Environment:

      MacOS 10.6, 64bit JDK6

      Description

      The test below loads an image using IIO. Loading finishes normally, but the listener's imageLoadMetaData method is never called.
      Put the attached bikes.bmp into /tmp directory.


      import com.sun.javafx.iio.ImageLoadListener;
      import com.sun.javafx.iio.ImageLoader;
      import com.sun.javafx.iio.ImageMetadata;
      import com.sun.javafx.iio.ImageStorage;
      import java.io.FileInputStream;
      import java.io.InputStream;
      import javafx.application.Application;
      import javafx.stage.Stage;


      public class ImageLoaderTest extends Application implements ImageLoadListener {
          
          public static void main(String[] args) {
              launch(ImageLoaderTest.class, args);
          }

          @Override public void start(Stage stage) {
              try {
                  InputStream in = new FileInputStream("/tmp/bikes.bmp");
                  ImageStorage.loadAll(in, this, 0, 0, true, false);
                  System.out.println("Image loaded");
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
              
          @Override public void imageLoadProgress(ImageLoader l, float p) {
          }
          @Override public void imageLoadWarning(ImageLoader l, String warning) {
          }
          @Override public void imageLoadMetaData(ImageLoader l, ImageMetadata metadata) {
              System.out.printf("Image size is %dx%d\n", metadata.imageWidth, metadata.imageHeight);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              peterz Peter Zhelezniakov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: