On Fri, 8 Aug 2025 17:31:03 GMT, Phil Race <p...@openjdk.org> wrote: > 4 of the 6 JDK ImageWriters flush the stream at the end of writing. 2 (TIFF > and GIF) do not. > > This will matter if you are using a caching ImageOutputStream. > > This fix makes it consistent.
src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java line 737: > 735: writeTrailer(); > 736: } > 737: stream.flush(); should we call flush or `flushBefore`(current stream position) as is being done in BMP writer? test/jdk/javax/imageio/FlushTest.java line 2: > 1: /* > 2: * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 2025? test/jdk/javax/imageio/FlushTest.java line 76: > 74: failed = true; > 75: } > 76: } finally { no need for finally block or do we need to do `baos.close` here since FileCacheImageOutputStream.close says "The destination OutputStream is not closed." ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26703#discussion_r2288019130 PR Review Comment: https://git.openjdk.org/jdk/pull/26703#discussion_r2287987561 PR Review Comment: https://git.openjdk.org/jdk/pull/26703#discussion_r2287988788