You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2020. It is now read-only.
This behavior seems to result from ImageIO internals and can be reproduced with images where only specific readers (from those that claim to be able to read the source) work as expected, e.g. on JPEG compressed images with "tif" filename extensions. See eu.transkribus.interfaces.types.ImageTest::testFromUrlToBufferedImage
Findings so far:
ImageIO registers Reader/Writer plugins internally in a HashMap and the order of the entry set may thus change over time
ImageIO::read iterates readers, takes the first one that returns true when calling ImageReaderSpi::.canDecodeInput and if the actual read operation fails throws an IIOException
IIORegistry::register returns false if a reader of the given type is already registered, according to its JavaDoc. BUT: acutally it deregisters the old instance and puts the new instance into the map, altering the order of the entry set. Subsequent registering of the same plugin will therefore change the behavior of ImageIO::read for certain images.
Steps taken so far:
Image type does not contain a static block registering Readers and Writers anymore. This was needed by web applications in Tomcat so far but is solved with a context listener that registers plugins on the classpath automatically.
ImageUtils has an alternative implementation of ImageIO::read that tries other candidate-readers first if one reader fails.
This behavior seems to result from ImageIO internals and can be reproduced with images where only specific readers (from those that claim to be able to read the source) work as expected, e.g. on JPEG compressed images with "tif" filename extensions. See eu.transkribus.interfaces.types.ImageTest::testFromUrlToBufferedImage
Findings so far:
Steps taken so far: