An exception is thrown from ImageFormatTool.convertImageFrame():
java.lang.IllegalArgumentException: Image scanlineStride is too small
at com.sun.prism.Image.<init>(Image.java:136)
at com.sun.prism.Image.fromByteBgraPreData(Image.java:43)
at com.sun.prism.ImageFormatTool.convertImageFrame(ImageFormatTool.java:43)
at ImageLoaderTest.start(ImageLoaderTest.java:26)
at com.sun.javafx.application.LauncherImpl$4.run(LauncherImpl.java:164)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:126)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:102)
A testcase is below; put the attached search.png into /tmp directory. It's also easy to reproduce with Browser demo, just open any Wikipedia article and you'll see the exception.
import com.sun.javafx.iio.ImageFrame;
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 com.sun.prism.ImageFormatTool;
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/search.png");
ImageFrame[] frames = ImageStorage.loadAll(in, this, 0, 0, true, false);
System.out.println("Image loaded");
for (int i=0; i<frames.length; i++) {
ImageFormatTool.convertImageFrame(frames[i]);
}
} 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);
}
}
java.lang.IllegalArgumentException: Image scanlineStride is too small
at com.sun.prism.Image.<init>(Image.java:136)
at com.sun.prism.Image.fromByteBgraPreData(Image.java:43)
at com.sun.prism.ImageFormatTool.convertImageFrame(ImageFormatTool.java:43)
at ImageLoaderTest.start(ImageLoaderTest.java:26)
at com.sun.javafx.application.LauncherImpl$4.run(LauncherImpl.java:164)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:126)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:102)
A testcase is below; put the attached search.png into /tmp directory. It's also easy to reproduce with Browser demo, just open any Wikipedia article and you'll see the exception.
import com.sun.javafx.iio.ImageFrame;
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 com.sun.prism.ImageFormatTool;
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/search.png");
ImageFrame[] frames = ImageStorage.loadAll(in, this, 0, 0, true, false);
System.out.println("Image loaded");
for (int i=0; i<frames.length; i++) {
ImageFormatTool.convertImageFrame(frames[i]);
}
} 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-8114621 Wikipedia rendering issues
- Closed
- duplicates
-
JDK-8114391 WebNode produces a serie of exceptions when rendering http://apple.com
- Closed
- relates to
-
JDK-8114001 ImageView is unable to display a specific BMP image
- Closed
-
JDK-8094635 ImageFormatTool.convertImageFrame() ignores stride for GRAY_ALPHA_PRE
- Closed