On Thu, 20 Aug 2026 14:01:07 GMT, Kevin Rushforth <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/javafx/util/ImageUtils.java
>> line 316:
>>
>>> 314: * @throws IOException
>>> 315: */
>>> 316: public static byte[] writeImage(Image im, String format) throws
>>> IOException {
>>
>> I wonder if there is a way to write bytes from a JavaFX `Image` without
>> using the Swing `BufferedImage`
>
> We don't have any code in JavaFX that does image writing. If we ever get to
> the point where this is the last thing that stops us from eliminating the
> dependency on `java.desktop`, then we could create a utility to do that
> (possibly by borrowing code from Image I/O). We would then move the rest of
> this back to `javafx.swing`, since there would no more need for the
> `BufferedImage` conversion methods to live in `javafx.graphics`.
Unfortunately, the fact that the application wants to leverage `ImageIO` and
`ImageIO` relies on AWT `BufferedImage` makes this task nearly impossible.
We are pretty much stuck with the current solution.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2267#discussion_r3823033545