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
Documentation:
"The TwelveMonkeys service providers for TIFF and JPEG overrides the onRegistration method, and utilizes the pairwise partial ordering mechanism of the IIOServiceRegistry to make sure it is installed before the Sun/Oracle provided JPEGImageReader and the Apple provided TIFFImageReader on OS X, respectively. "
Unless you are using the Apple-provided TIFFImageReader, there is no explicit pairwise ordering. So your result is not unexpected (the order is simply undefined).
The reason we do the ordering in some special cases, is to make sure you are using our plugins instead of the bundled plugins. For non-bundled plugins, users have made a choice to include these plugins, and also have more control over the registration process, so it makes less sense to do explicit ordering by default (and consider what would happen, if all third-party plugins made sure they were ordered first...).
I assume you are using the TIFFImageReader from JAI ImageIO (jai-imageio.jar). Then you can change the order, either by removing the other plugins from class path, by modifying the class path order (first on class path will be registered first), or by using code similar to the one found in com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderSpi.
Documentation:
"The TwelveMonkeys service providers for TIFF and JPEG overrides the onRegistration method, and utilizes the pairwise partial ordering mechanism of the IIOServiceRegistry to make sure it is installed before the Sun/Oracle provided JPEGImageReader and the Apple provided TIFFImageReader on OS X, respectively. "
Code:
Iterator jpegReaders = ImageIO.getImageReadersByFormatName("JPEG");
while (jpegReaders.hasNext()) {
System.out.println("jpeg reader: " + jpegReaders.next());
}
Iterator tiffReaders = ImageIO.getImageReadersByFormatName("TIFF");
while (tiffReaders.hasNext()) {
System.out.println("tiff reader: " + tiffReaders.next());
}
result:
jpeg reader: com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader@5dadd1c5
jpeg reader: com.sun.imageio.plugins.jpeg.JPEGImageReader@4929a06b
tiff reader: com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader@247ab39
tiff reader: com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader@5f3f333c
So the tiff reader isn't in front :-( Or does the documentation mean that it only applies to OSX?
The text was updated successfully, but these errors were encountered: