Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to load compressed tiff image formats with JIMI

 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic