Skip to main content

Getting meta data from TIFF on OS X

5 replies [Last post]
lostinspace2011
Offline
Joined: 2007-08-01

I am trying to extract the Image meta data from a TIFF. However ImageIO.getReaderFormatNames() does not list tif as a valid format name and ImageIO.getImageReadersByFormatName("tif") also does not return any matches. I am using JDK 1.6.15 on OS X 10.6.1. If you have any suggestion on how to use TIFFImageReader please let me know.

Thanks in advance
Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lostinspace2011
Offline
Joined: 2007-08-01

Any pointers on how to install it. I downloaded the JAI LIB (jai-1_1_3-lib.zip) and added it to my classpath, endorsed path and bootclasspath, but neither seemed to make any difference. I had a look for an OS X download for JAI ImageIO, but there doesn't seem to be one available.

Any suggestions on how to do this?

Harald Kuhr

You also need JAI ImageIO.

There is no still native accelerated version for OS X (that I know
of), but the pure Java stuff should still work. I got the classpath
version for Solaris, but I guess any OS/arch will do, as you won't get
native acceleration any way. Probably completely unsupported, but if
it works for you...

I then added jai_core.jar, jai_codec.jar and jai_imageio.jar to my
classpath and was able to read TIFF and metadata just fine.

Good luck,

--
Harald K

On 31. okt.. 2009, at 09.43, jai-imageio@javadesktop.org wrote:

> Any pointers on how to install it. I downloaded the JAI LIB
> (jai-1_1_3-lib.zip) and added it to my classpath, endorsed path and
> bootclasspath, but neither seemed to make any difference. I had a
> look for an OS X download for JAI ImageIO, but there doesn't seem to
> be one available.
>
> Any suggestions on how to do this?
> [Message sent by forum member 'lostinspace2011' (alex@j2anywhere.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=370037
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

lostinspace2011
Offline
Joined: 2007-08-01

Yes, I have tried using tiff as well. Listing the supported formats only shows:

Version 1.6.0_15
Getting readers
AvailableFormat : jpg
AvailableFormat : BMP
AvailableFormat : bmp
AvailableFormat : JPG
AvailableFormat : wbmp
AvailableFormat : jpeg
AvailableFormat : png
AvailableFormat : PNG
AvailableFormat : JPEG
AvailableFormat : WBMP
AvailableFormat : GIF
AvailableFormat : gif

Harald Kuhr

On 30. okt.. 2009, at 23.03, jai-imageio@javadesktop.org wrote:

> Yes, I have tried using tiff as well.

Sorry, that was a joke. But it doesn't look like you have JAI ImageIO
(correctly) installed, as the formats you list are only the ones
provided by the JDK by standard.

So you must either:
- Manually register the TIFFImageReaderSpi that comes bundled with OS
X (as I said in my previous email). I think you can put a file META-
INF/services/ImageReaderSpi with one line, containing
"com.sun.imageio.plugins.tiff.TIFFImageReaderSpi" (without the quotes)
and place in classpath. It's a hack, and I haven't tried it..
- Or install JAI ImageIO, which is probably what you want, as this is
the JAI ImageIO mailing list.

Good luck,

--
Harald K

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

haraldk
Offline
Joined: 2005-05-10

Hi Alex,

Did you try using "tiff" instead? ;-)

Also, the TIFFImageReaderSpi that comes with OS X (not to be confused with the one from JAI) is not registered with ImageIO by default. You can register it manually, otherwise it's automatically registered after Toolkit initialization (not sure if this is a good thing to depend on though...).

Not sure how good the meta data support is, so it might be better to use the JAI ImageIO version.

.k