-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[native-image] Use of Graphics fails #1163
Comments
I'm having the same problem...works great in a JAR, fails spectacularly as a native image. I'm building the native image via Quarkus, so I'm using graalvm-ce-1.0.0-rc16. When I invoke my code, I get this error: UT005023: Exception handling request to /overlayImage: org.jboss.resteasy.spi.UnhandledException: java.lang.UnsupportedOperationException: Not implemented yet for GraalVM native images After a relatively long stack trace, I get this more specific message: Caused by: java.lang.UnsupportedOperationException: Not implemented yet for GraalVM native images May or may not be relevant: The call that fails isn't accessing the file system, it's trying to create an image from a base64 string passed in to the method. Here's the line that fails:
Hope this sheds some light on the problem. |
@cstancu any plans for java.awt.Graphics support in Substrate VM ? I hit this problem when playing with JFreeChart and JFreeSVG in native mode using Quarkus. |
@cstancu bumping this. If there are no plans, it would be good to for the community to begin coalescing around an alternative. |
Also bumping everything in my application works when built for native except the ability to save images |
I’m using https://commons.apache.org/proper/commons-imaging/ as a replacement which so far works just fine in a native Linux executable. |
Just incase anyone wants to write iamges from a url to a file I managed to use this instead of Imageio
This seems to work better too since it works with more filetypes and saves gif/video properly |
How do you get the imagedata without using bufferedimage? Can you post some code here? |
@smil2k take a look at https://commons.apache.org/proper/commons-imaging/sampleusage.html. You only replace |
Hi. When will this feature be added? I don't have a way to draw an image as the captcha code without Graphics. And it seems that there's no alternative. @cstancu |
@sherl0cks: Can you send some example code which compiles with graal into native image and uses buffered images? For me it did not, first I needed to provide the color profiles, then it was stopped somewhere again with "not implemented", thrown at runtime! |
I no longer have code on this, my team moved to python for image manipulation. My suspicion is that your not implemented is related to ImageIO, not buffered images, but I'm not in a position to help at this time. |
@cstancu I'm looking at some code again that needs |
@vjovanov Any thoughts on how we may collaborate here? |
20.3 will include AWT and Swing that work on JDK 11. Please try it out in a few days on the master branch or wait for 20.3 release. |
@vjovanov This is great news but what about javax.imageio.ImageIO? |
At revision c92adba of graal master I'm getting (producing the native image works) the following trace on the initial ImageIO example from the reporter:
So there is still work left to do for ImageIO to work. |
Have you generated the config first with an agent? AWT is still not supported without configuration. |
I have not. Let me try that now. |
OK that seems to work for png images illustrated in
|
Can we close the issue? |
@jerboaa: for the record, could you tell me how did you created the "config with an agent" for graalvm? |
We have documentation on that: https://github.com/oracle/graal/blob/master/substratevm/BuildConfiguration.md |
@smil2k See #1163 (comment) The |
While creating a native build with spring 3.0 at that time AWT has not supported any idea or any suggestion for to achieve this issue. You can refer to this issue as well spring-projects/spring-framework#29704. |
Minimum Example1.java:
The code can be executued with GraalVM:
sudo docker run -v $(pwd):/work -w /work oracle/graalvm-ce:1.0.0-rc15 sh -c "javac Example1.java && java Example1"
But it is not working as Native Image:
sudo docker run -v $(pwd):/work -w /work oracle/graalvm-ce:1.0.0-rc15 sh -c "native-image Example1 && ./example1"
Error:
The text was updated successfully, but these errors were encountered: