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

Reading Image with JIMI  RSS feed

 
Alejandro Barrero
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a problem reading an image with JIMI.

The problem is that the image displays as a black image. Everything works if I use ImageIO.read, but with ImageIO.read I get a java heap exception the third time the code runs.
I don't want to use JAI because i think it uses the same code as ImageIO.read.

Your help will be greatly appreciated.
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the documentation for the Jimi class?
When loading images, there are several flags available:

* ASYNCHRONOUS: This flag requests that images be loaded asynchronously, so the method will return immediately and the image will be populated with pixel data with a separate thread.
This is a default flag.
* SYNCHRONOUS: This flag requests that the image be fully loaded before the getImage call returns.

-Jimi technical guide
 
Alejandro Barrero
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe. I tried with
Image image = Jimi.getImage(inputStream, Jimi.SYNCHRONOUS);
but still got the same problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!