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

Tilman Hausherr edited comment on PDFBOX-1963 at 3/7/14 12:47 PM:
------------------------------------------------------------------

The refactoring took away the possibility to decide on the type of the 
BufferedImage, especially for bitonal images, which is a requirement for TIFF 
CCITT G4 compression. [Edit: ImageIOUtils uses the imagetype to choose the G4 
compression or the LZW compression, see the code and PDFBOX-1734. G4 
compression isn't allowed for RGB images even if they have just b/w in it, 
because java doesn't count the # of actual colors] Please find a solution. I 
also don't understand why you took away the PDPage parameter and are using a 
page index instead, and then get a PDPage object again from that.

The modified TIFF testing code in TestImageIOUtils.java doesn't do the test 
anymore - the old code had one test for RGB and one test for BITONAL. Now it 
has two tests - only the file names differ, not the filetypes, so an identical 
image is created.


was (Author: tilman):
Your refactoring that "needed" to be done took away the possibility to decide 
on the type of the BufferedImage, especially for bitonal images, which is a 
requirement for TIFF CCITT G4 compression. [Edit: ImageIOUtils uses the 
imagetype to choose the G4 compression or the LZW compression, see the code and 
PDFBOX-1734. G4 compression isn't allowed for RGB images even if they have just 
b/w in it, because java doesn't count the # of actual colors] Please find a 
solution. I also don't understand why you took away the PDPage parameter and 
are using a page index instead, and then get a PDPage object again from that.

You also modified the TIFF testing code in TestImageIOUtils.java so that it 
doesn't do the test anymore - the old code had one test for RGB and one test 
for BITONAL. Now it has two tests - only the file names differ, not the 
filetypes, so an identical image is created.

> PDFImageWriter doesn't make use of PDFStreamEngine
> --------------------------------------------------
>
>                 Key: PDFBOX-1963
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1963
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>             Fix For: 2.0.0
>
>
> PDFImageWriter is a subclass of PDFStreamEngine, however it never uses any of 
> its functionality, the writeImage methods could be marked as static and 
> behave in the same manner.
> The relationship between PDFImageWriter, RenderUtil, and ImageIOUtil no 
> longer matches its historical origins and needs to be refactored.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to