| From | Sent On | Attachments |
|---|---|---|
| Fabrizio Giudici | Jun 14, 2007 4:48 am | |
| mja...@union06.de | Jun 14, 2007 5:08 am | |
| Fabrizio Giudici | Jun 14, 2007 5:20 am | |
| robert engels | Jun 14, 2007 6:41 am | |
| Fabrizio Giudici | Jun 14, 2007 1:55 pm | |
| robert engels | Jun 14, 2007 2:25 pm | |
| Fabrizio Giudici | Jun 14, 2007 4:07 pm | |
| jai-...@javadesktop.org | Jun 14, 2007 6:14 pm | |
| robert engels | Jun 14, 2007 6:26 pm | |
| Brian Burkhalter | Jun 14, 2007 6:28 pm | |
| robert engels | Jun 14, 2007 6:30 pm | |
| Brian Burkhalter | Jun 14, 2007 6:31 pm | |
| mja...@union06.de | Jun 15, 2007 12:09 am |
| Subject: | RE: [JAI-IMAGEIO] Strange problem with TIFF reading on Mac OS X | |
|---|---|---|
| From: | mja...@union06.de (mja...@union06.de) | |
| Date: | Jun 14, 2007 5:08:53 am | |
| List: | net.java.dev.jai-imageio.interest | |
Did you realize that MAC files might have a MAC binary header consisting of 128 (right?) bytes with information about the resource fork? Maybe ImageIO is not able to handle this because it doesn't have system specific code.
The first two bytes should be 0x49 0x49 (II = Intel-Format) or 0x4D 0x4D (MM = Motorola-Format).
I remember about 4/5 years ago I had the same problem with images uploaded from MAC to Solaris.
Kind regards, Marco -- Marco Jacob, PMP Prisma GmbH, Germany
Hello. I use the following code to find out the ImageReader to deal with a certain file: private static ImageReader createImageReader (final ImageInputStream imageInputStream, final String suffix) throws IOException { try { for (Iterator<ImageReader> iterator = ImageIO.getImageReadersBySuffix(suffix); iterator.hasNext();) { ImageReader reader = iterator.next(); String pluginClassName = reader.getOriginatingProvider().getPluginClassName(); logger.finer(">>>> testing reader: " + reader + ", pluginClassName: " + pluginClassName); if ((reader != null) && !unwantedPlugins.contains(pluginClassName) && reader.getOriginatingProvider().canDecodeInput(imageInputStream)) { reader.setInput(imageInputStream); logger.finer(">>>> returning reader: " + reader + ", pluginClassName: " + pluginClassName); return reader; } }
throw new IOException("No ImageReader for the suffix: " + suffix); } Of course JAI-IMAGEIO is in the classpath. In facts in the log I see: 13:24:02.810 [AWT-EventQueue-1 ] FINE ReadOp - getImageReader(/Users/fritz/Business/Tidalwave/Projects/blueMarine/Test/Pleiades Small Set/w1.tif) 13:24:02.810 [AWT-EventQueue-1 ] FINER ReadOp - >>>> suffix is tif 13:24:02.812 [AWT-EventQueue-1 ] FINER ReadOp - >>>> testing reader: com.sun.imageio.plugins.tiff.TIFFImageReader@5b8c7f, pluginClassName: com.sun.imageio.plugins.tiff.TIFFImageReader Nevertheless, the "canDecodeInput()" returns false and the method fail. This happens only on Mac OS X; the same application works fine with Linux and Windows. What's the problem? PS Maybe I've read in the past months about a possible problem with TIFFs and Mac OS X but I can't recall. -- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - [1]www.tidalwave.it/blog [2]Fabr...@tidalwave.it - mobile: +39 348.150.6941
References
Visible links 1. http://www.tidalwave.it/blog 2. mailto:Fabr...@tidalwave.it





