[ 
https://issues.apache.org/jira/browse/PDFBOX-4285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570481#comment-16570481
 ] 

Alexandre Moraes do Nasciment commented on PDFBOX-4285:
-------------------------------------------------------

The only thing that I changed to test the JPEG compression was in the 
setCompressionType function in TIFFUtil class.
{code:java}
// code placeholder

public static void setCompressionType(ImageWriteParam param, BufferedImage 
image){
// avoid error: first compression type is RLE, not optimal and incorrect for 
color images
// TODO expose this choice to the user?
if (image.getType() == BufferedImage.TYPE_BYTE_BINARY &&
image.getColorModel().getPixelSize() == 1)
{
   param.setCompressionType("CCITT T.6");
}
else
{
   param.setCompressionType("JPEG");
}
}
{code}
But the TiffImageWriter that I´m using is from the package 
com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter. I don´t know if the 
implementation is different ffrom the com.github.jaiimageio package.

Here is the dependency that I used:

<dependency>
 <groupId>javax.media</groupId>
 <artifactId>jai_imageio</artifactId>
 <version>1.1.1</version>
 </dependency>

from this repository:

<repository>
 <id>Geotoolkit</id>
 <name>Geotoolkit</name>
 <url>http://maven.geotoolkit.org/</url>
 </repository>

 

> Expose the tiff compression type to the user.
> ---------------------------------------------
>
>                 Key: PDFBOX-4285
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4285
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Writing
>    Affects Versions: 2.0.11
>            Reporter: Alexandre Moraes do Nasciment
>            Priority: Major
>              Labels: TIFF
>
> Allow the user to set the compression type of Tiff files externally.
> In the current version, the class ImageIOUtil uses 
> TIFFUtil.setCompressionType and this sets the compression only to "CCITT T.6" 
> or "LZW". 
> Other choice could be allow the jpeg compression that is more efficient.
> It already has a TODO in code (// TODO expose this choice to the user?)
> Thank you.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to