This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes how to load compressed tiff image formats with JIMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "how to load compressed tiff image formats with JIMI" Watch "how to load compressed tiff image formats with JIMI" New topic
Author

how to load compressed tiff image formats with JIMI

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

this method


returns incorrect Image width & height (-1) for TIFF compressed formats.
when i try this code with jpg or tiff images that are not using compression;it just works fine.
but when i use a tiff file with lzw compression the jimi code for image loading is returning -1 for image width & height .why ?

is there any jimi example showing how to properly load the tiff compressed image ?

thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42028
    
  64
JIMI does not support all kinds of compressed TIFFs.

This plugin for the javax.imageio.ImageIO class supports compressed TIFFs.
[ May 07, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Thanks for replying

is this plugin part of jimi or is it plugin for another product ?

is it possible to extend jimi to support compressed tiff ?
my customer don't want to make the risk of moving from jimi to another Image library as this will delay our project.

i would appreciate some help on this.

thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42028
    
  64
It's not a plugin for JIMI, it's a plugin for ImageIO (which is part of the JRE).

Sun doesn't make the JIMI source code available, so it's not easy to extend it. You can probably rip out the TIFF code form that plugin and put JIMI interfaces on top of it, though, if you need it badly.

But, as the page I linked to mentions, JIMI is substantially an 8-bit library, which limits its usefulness for many applications. I'd advise to consider moving away from it.
[ May 08, 2007: Message edited by: Ulf Dittmer ]
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

thanks for clarifications.

can you please show me a simple code on how to use above plugin to load tiff lzw compressed images ? or may be point me to where i can find such sample codes.

thanks.
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

I'm considering moving to JAI (java advanced imaging).

is it a good choice ? do you have an Idea if JAI supports tiff compressed imgs loading ?

thanks.
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

I'm considering moving to JAI (java advanced imaging).

is it a good choice ? do you have an Idea if JAI supports tiff compressed images loading ?

thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42028
    
  64
My impression is that JAI is dead for all practical purposes. It does what it does, but it's not likely to do much more in the future. I wouldn't advise anybody to move towards it.
[ May 08, 2007: Message edited by: Ulf Dittmer ]
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

thanks anyway ulf.
can i ask this further question ?

this method converts Image to BufferedImage.


it works good for image files that aren't compressed.
however when i try it with a compressed 8MB tiff file it throws the following exception:


what could be the problem ?

how can i write a robust tobufferedImage() method that supports tiff compressed files?

thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to load compressed tiff image formats with JIMI