--- old/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java 2018-06-06 12:58:53.684659072 -0700 +++ new/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java 2018-06-06 12:58:53.460659081 -0700 @@ -73,7 +73,11 @@ public boolean canEncodeImage(ImageTypeSpecifier type) { SampleModel sampleModel = type.getSampleModel(); + ColorModel cm = type.getColorModel(); + if (cm.hasAlpha()) { + return false; + } // Find the maximum bit depth across all channels int[] sampleSize = sampleModel.getSampleSize(); int bitDepth = sampleSize[0];