Cannot load jpeg images on Fedora 34
Robert Lichtenberger
r.lichtenberger at gmail.com
Wed Jun 2 10:43:10 UTC 2021
Using this testapplication:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ImageTest extends Application {
@Override
public void start(Stage stage) throws Exception {
Image img = new
Image("https://www.synedra.com/_thumbnails_/606_11_robert_lichtenberger.jpg");
if (img.isError()) {
System.out.println(img.getException());
}
ImageView imgView = new ImageView(img);
StackPane stack = new StackPane();
stack.getChildren().add(imgView);
Scene scene = new Scene(stack, 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
And running it with regular JavaFX-16 (downloaded from gluonhq), I get:
[rli at rlimbus javafx]$ java --module-path
/home/rli/Downloads/javafx-sdk-16/lib --add-modules
javafx.controls,javafx.fxml ImageTest
java.io.IOException: Wrong JPEG library version: library is 62, caller
expects 90
and the image will not be loaded.
The same happens for all other regular JavaFX SDKs (even tried LTS 11.0.12).
When I compile JavaFX myself, it works as expected:
[rli at rlimbus javafx]$ java --module-path
/home/rli/PWEs/jfx/build/sdk/lib --add-modules
javafx.controls,javafx.fxml ImageTest
The problem seems to be related to the OS version, because on Fedora 33
everything works fine.
Other applications are also impacted, e.g. AsciidocFX cannot show
previews of jpeg images on Fedora 34.
Any hints / ideas appreciated.
Robert
More information about the openjfx-dev
mailing list