On Thu, 20 Aug 2026 17:15:25 GMT, Marius Hanl <[email protected]> wrote:

>> // yes it can:
>> byte[] b = null;
>> 
>> 
>> 
>> StubToolkit cannot write jpg.  The test works with the real toolkit.
>
> I mean in our `writeImage` case, null is never returned, no? Could we perhaps 
> split the jpg tests, because I like that we test `assertTrue(b.length > 0);` 
> for `png` and `gif` with an opaque pixel. And for the jpg test, we then could 
> test, that the `length == 0` perhaps?

The test StubToolkit is somewhat deficient by design - it also cannot scale 
images.  

You are right, checking for non-null byte[] is silly (it comes from the 
ByteArrayOutputStream). I've left the test in place to test for lack of 
exceptions, basically.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2267#discussion_r3823776812

Reply via email to