首页 > 编程知识 正文

java将文本压缩(java解压文件)

时间:2023-05-03 07:47:07 阅读:72577 作者:1967

I ' mtryingtoconvertabitmapimageintoanuncompressedtiffileforusewiththetesseractocrengine。

icanusethismethodtoproduceacompressedtiffile .

finalbufferedimagebmp=imageio.read (new file (' input.BMP ' );

imageio.write(BMP,' jpg ',newfile ) ) output.TIF );

thisproducesanemptytiffilewhenthe ' jpg ' ischangedtotifasthesefilesaredealtwithinjavaaadvancedimaging (jai )。

howcanicreateanuncompressedtifimage? shouldidecompressthetifimageproducedfromtheabovecodeoristhereanotherwaytohandletheconversionprocess?

anyexamplesprovidedwouldbemuchappreciated。

kingh32

youcanuseimagewriteparamtodisablecompression :

tiffimagewriterspispi=newtiffimagewriterspi (;

param.setcompressionmode (imagewriteparam.mode _ disabled;

writer.setoutput(IOs;

writer.write(null,newiioimage ) BMP,null,null ),param );

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。