Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable watermarking images, fonts rendering and all JDK supported image formats in AWT Extension #20565

Closed
19 tasks done
Karm opened this issue Oct 6, 2021 · 4 comments · Fixed by #20850
Closed
19 tasks done
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@Karm
Copy link
Member

Karm commented Oct 6, 2021

Description

Use case:

  • watermarking images
  • drawing, server side generated graphics

Status:

WIP:
Done means there is a suite of rigorous tests exercising the relevant code paths, e.g. for encoders only it's 964 test cases of image type:image format:colour space:compression.

  • Showcase in a Quick start: awt-graphics-rest-quickstart (needs not yet published AWT extension update)
  • TIFF Decoder; all compressors; metadata
  • TIFF Encoder; all compressors; metadata; multiple images in a container
  • PNG Decoder; all compressors; layers; metadata
  • PNG Encoder; all compressors; metadata
  • GIF Decoder; all compressors; animations; metadata
  • GIF Encoder; all compressors; metadata
  • JPEG Decoder; metadata
  • JPEG Encoder; metadata
  • BMP Decoder; all compressors; metadata
  • BMP Encoder; all compressors; (metadata immutable, so just the default)
  • WBMP Decoder; metadata
  • WBMP Encoder; (metadata immutable, so just the default)
  • Fonts, both embedded and loading one's own: It's done in the aforementioned Quick start, I just need to do some streamlined copy-pasting :) to the extension's integration tests.
  • Geometry, full Java2D suite, building on the foundation I have in /mandrel-integration-tests
  • Rinse and repeat on JDK 17 as all the above work is being done with JDK 11.0.13 ea.
  • Rinse and repeat on Windows, which will bring some additional changes. All the aforementioned work in being done on Linux.
  • README me for the test suite
  • Docs for the extension

Implementation affects:

  • recent awt extension
  • core, switching Quarkus to be headless by default , i.e.
@@ -52,6 +52,13 @@ public class NativeConfig {
     @ConfigItem(defaultValue = "true")
     public boolean enableJni;
 
+    /**
+     * The default value for java.awt.headless JVM option.
+     * Switching this option affects linking of awt libraries.
+     */
+    @ConfigItem(defaultValue = "true")
+    public boolean headless;
+
...
@@ -597,6 +597,10 @@ public class NativeImageBuildStep {
                 nativeImageArgs.add("-H:+JNI");
                 nativeImageArgs.add("-H:+AllowFoldMethods");
 
+                if (nativeConfig.headless) {
+                    nativeImageArgs.add("-J-Djava.awt.headless=true");
+                }
+

Implementation ideas

@gastaldi Assign the issue to me, please.

@Karm Karm added the kind/enhancement New feature or request label Oct 6, 2021
@Karm
Copy link
Member Author

Karm commented Oct 6, 2021

@galderz @jerboaa The issue to bind the upcoming PRs to....

@galderz
Copy link
Member

galderz commented Oct 8, 2021

I'm happy with the proposal. I think having the native image configuration options would be useful too, to avoid relying on implicit local environment, or docker image specific, setups.

@Karm
Copy link
Member Author

Karm commented Oct 15, 2021

Updated description with a checklist of progress.

@Karm
Copy link
Member Author

Karm commented Oct 17, 2021

Linux and JDK 11.0.13+7 tested AWT extension:

https://github.com/Karm/quarkus/tree/awt-extension-proper

Linux and JDK 11.0.13+7 tested AWT quickstart:

https://github.com/Karm/quarkus-quickstarts/tree/quarkus-awt/awt-graphics-rest-quickstart

@quarkus-bot quarkus-bot bot added this to the 2.6 - main milestone Dec 7, 2021
megian pushed a commit to megian/codecentric-helm-charts that referenced this issue Feb 23, 2024
There is a a lot of evidence that the parameter is set to `java.awt.headless=true` in Quarkus by default.

* Quarkus Building native Images: https://quarkus.io/guides/building-native-image) see default value for `java.awt.headless`
* quarkusio/quarkus#20565
* quarkusio/quarkus#20850
megian pushed a commit to megian/codecentric-helm-charts that referenced this issue Mar 4, 2024
There is a a lot of evidence that the parameter is set to `java.awt.headless=true` in Quarkus by default.

* Quarkus Building native Images: https://quarkus.io/guides/building-native-image) see default value for `java.awt.headless`
* quarkusio/quarkus#20565
* quarkusio/quarkus#20850

Signed-off-by: Gabriel Mainberger <[email protected]>
megian pushed a commit to megian/codecentric-helm-charts that referenced this issue Jul 1, 2024
There is a a lot of evidence that the parameter is set to `java.awt.headless=true` in Quarkus by default.

* Quarkus Building native Images: https://quarkus.io/guides/building-native-image) see default value for `java.awt.headless`
* quarkusio/quarkus#20565
* quarkusio/quarkus#20850

Signed-off-by: Gabriel Mainberger <[email protected]>
megian pushed a commit to megian/codecentric-helm-charts that referenced this issue Jul 3, 2024
There is a a lot of evidence that the parameter is set to `java.awt.headless=true` in Quarkus by default.

* Quarkus Building native Images: https://quarkus.io/guides/building-native-image) see default value for `java.awt.headless`
* quarkusio/quarkus#20565
* quarkusio/quarkus#20850

Signed-off-by: Gabriel Mainberger <[email protected]>
pascal-sochacki pushed a commit to codecentric/helm-charts that referenced this issue Jul 5, 2024
There is a a lot of evidence that the parameter is set to `java.awt.headless=true` in Quarkus by default.

* Quarkus Building native Images: https://quarkus.io/guides/building-native-image) see default value for `java.awt.headless`
* quarkusio/quarkus#20565
* quarkusio/quarkus#20850

Signed-off-by: Gabriel Mainberger <[email protected]>
Co-authored-by: Gabriel Mainberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants