This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ImageIO.write - TIF and BMP - Zero bytes  RSS feed

 
ramesh agarwal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I executed the code below from:



The generated files are ok except for BMP and TIF are zero bytes each.

What could be the problem? I am using JDK 1.6.0
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TIF is quite logical, that's not supported by default (check ImageIO.getWriterFormatNames()). BMP is though, at least on my machine.

I've even tried the following: Yet somehow, even though they are supported, BMP and WBMP give empty files. Odd indeed.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting. I'm getting zero-length BMP/WBMP in Java 5 on OS X as well. I was in the past successful in generating BMPs using ImageIO, though.

Info on how to TIFF-enable ImageIO
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Converting Images to BMP/WMBP for some subtleties.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!