Skip to main content

JPEG in TIFF

3 replies [Last post]
spgmx
Offline
Joined: 2009-05-10

Hi,

I create a TIFF from a JPEG:

writeParam = new TIFFImageWriteParam(Locale.ENGLISH);
writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
writeParam.setCompressionType("JPEG");
writeParam.setCompressionQuality(0.75f);
writeParam.setTilingMode(ImageWriteParam.MODE_EXPLICIT);
writeParam.setTiling(bi.getWidth(), bi.getHeight(), 0, 0);
IIOImage img = new IIOImage(bi, null, null);
writer.write(null, img, writeParam);

The TIFF is create and viewable with irfan-view. But is is not viewable with Microsoft's TIFF Viewers like MODI, PAINT or with Paint.NET.

What is the problem here?

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
spgmx
Offline
Joined: 2009-05-10

I found out that GDI+ on windows has some problem with JPEG-TIFF...

http://support.microsoft.com/?scid=kb%3Ben-us%3B885938&x=10&y=12

Has anybody an idea how to workaround the problem?

Thank you

chcornwell
Offline
Joined: 2004-09-16

Doesn't the TIFF encoder support

writeParam.setCompressionType("LZW");

?

spgmx
Offline
Joined: 2009-05-10

Yes it does. But LZW mean HUGE TIFF files.
Therefore I need JPEG.