Class JPEGSegmentImageInputStream.DownsampledDQTReplacement

  • Enclosing class:
    JPEGSegmentImageInputStream

    static final class JPEGSegmentImageInputStream.DownsampledDQTReplacement
    extends JPEGSegmentImageInputStream.ReplacementSegment
    Workaround for a known bug in com.sun.imageio.plugins.jpeg.DQTMarkerSegment, throwing exception, if the DQT precision is 16 bits (not 8 bits). Native reader seems to cope fine though. This downsampling of the quality tables, creates visually same results, with no exceptions thrown.
    • Constructor Detail

      • DownsampledDQTReplacement

        DownsampledDQTReplacement​(long realStart,
                                  long start,
                                  long realLength,
                                  int qtInfo,
                                  javax.imageio.stream.ImageInputStream stream)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • createMarkerFixedLength

        private static byte[] createMarkerFixedLength​(int length,
                                                      int qtInfo,
                                                      javax.imageio.stream.ImageInputStream stream)
                                               throws java.io.IOException
        Throws:
        java.io.IOException