-
Bug
-
Resolution: Fixed
-
P3
-
fx2.0
-
MacOS 10.6, 64bit JDK6
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);
}
}
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);
}
}
- blocks
-
JDK-8114224 BMP images display is not supported in WebNode
- Closed