Cannot load jpeg images on Fedora 34
Robert Lichtenberger
r.lichtenberger at gmail.com
Mon Jun 7 15:12:32 UTC 2021
I've analysed the problem described below and found out that:
* When building JavaFX from master-branch, the problem is gone
* When building from tags/16+8, the problem is present
And finally I found https://bugs.openjdk.java.net/browse/JDK-8211362
(Restrict export of libjpeg symbols from libjavafx_iio.so) together with
https://git.openjdk.java.net/jfx/pull/442 from Johan Vos.
When I apply the changes in buildSrc/linux.gradle to tags/16+8, the
problem goes away.
I also found out that Fedora 34 is not the only Linux distribution
affected by the problem.
So the good news is, the problem will probably vanish with JavaFX 17.
But the question remains whether the fix should be backported, since a
lot of JavaFX applications will not work correctly under various modern
Linux distributions.
Best regards,
Robert
Am 6/2/21 um 12:43 PM schrieb Robert Lichtenberger:
> 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