aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes ImageIO.write - TIF and BMP - Zero bytes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ImageIO.write - TIF and BMP - Zero bytes" Watch "ImageIO.write - TIF and BMP - Zero bytes" New topic
Author

ImageIO.write - TIF and BMP - Zero bytes

ramesh agarwal
Greenhorn

Joined: Jun 10, 2008
Posts: 19
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

Joined: Oct 27, 2005
Posts: 19538
    
  16

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
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


Ping & DNS - updated with new look and Ping home screen widget
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
See Converting Images to BMP/WMBP for some subtleties.
 
 
subject: ImageIO.write - TIF and BMP - Zero bytes
 
Similar Threads
Centering
Checkers
Problem running Servlet
getting class file in java
Extracting Pixel Data From Fonts