RFR: 8351108: ImageIO.write(..) fails with exception when writing JPEG with IndexColorModel [v4]

Jeremy Wood duke at openjdk.org
Mon Mar 10 18:22:49 UTC 2025


> Previously ImageTypeSpecifier treated all TYPE_BYTE_INDEXED as if they were opaque.
> 
> In this ticket's case: an ImageWriter received the wrong ImageTypeSpecifier and mistakenly indicated it *could* support a BufferedImage. But when the actual BufferedImage arrived (which was translucent), the ImageWriter threw an exception.
> 
> Instead:
> Now the ImageTypeSpecifier accurately describes the given BufferedImage.

Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision:

  8351108: changing Error to Exception, adding javadoc
  
  This is partly in response to:
  https://github.com/openjdk/jdk/pull/23884#discussion_r1987733487

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23884/files
  - new: https://git.openjdk.org/jdk/pull/23884/files/deaa0377..a69c2e05

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23884&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23884&range=02-03

  Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23884.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23884/head:pull/23884

PR: https://git.openjdk.org/jdk/pull/23884


More information about the client-libs-dev mailing list