title: How to exclude specific TIFF reader from ImageIO?
body: <p>Stack:</p>
  
  <ul>
  <li>Java - 1.8.0_91</li>
  <li>Scala - 2.11.8</li>
  <li>Library - it.geosolutions.imageio-ext imageio-ext-tiff 1.1.15</li>
  </ul>
  
  <p>We are reading lots of old TIF images and for some reason read is highly inconsistent - for some reasons on a different run reading the same image can succeed or fail with exception - </p>
  
  <pre><code>javax.imageio.IIOException: Invalid component ID 3 in SOS
  at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
  at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1236)
  at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1039)
  at com.sun.media.imageioimpl.plugins.tiff.TIFFOldJPEGDecompressor.decodeRaw(TIFFOldJPEGDecompressor.java:654)
  at com.sun.media.imageio.plugins.tiff.TIFFDecompressor.decode(TIFFDecompressor.java:2527)
  at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.decodeTile(TIFFImageReader.java:1137)
  at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.read(TIFFImageReader.java:1417)
  </code></pre>
  
  <p>The code is something like this:</p>
  
  <pre><code>import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
  import javax.imageio.ImageIO
  
  def convertToPng(data: Array[Byte]): Array[Byte] = {
      val inputStream = new ByteArrayInputStream(data)
      val image = ImageIO.read(inputStream)
      val outputStream = new ByteArrayOutputStream(inputStream.available())
      ImageIO.write(image, "png", outputStream)
      outputStream.toByteArray
  }
  </code></pre>
  
  <p>The problem is ImageIO initializes 2 TIFF readers at the same time</p>
  
  <pre><code> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader &amp; 
   it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader
  </code></pre>
  
  <p>OR</p>
  
  <pre><code> it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader
   com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader 
  </code></pre>
  
  <p>The first one fails, the second one works.
  How to exclude com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader from ImageIO configuration?</p>