pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PDFBOX-2068) Add filter parameter to PDImageXObject(document, filteredStream) constructor
Date Mon, 02 Jun 2014 12:07:01 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tilman Hausherr updated PDFBOX-2068:
------------------------------------

    Description: 
I am adding a third parameter to
{code}
public PDImageXObject(PDDocument document, InputStream filteredStream)
{code}
i.e. changing it to
{code}
public PDImageXObject(PDDocument document, InputStream filteredStream, COSBase cosFilter)
{code}
because in the code, the filter is always set afterwards. My change improves code clarity.
The caller _knows_ what filter was used because he used it to prepare the filteredStream content.

WDYT about also adding width, height, bpc and colorspace to that constructor? These four parameters
are always used.

This cool guy (enter his name on youtube) has arguments to use constructors parameters instead
of setters:
http://misko.hevery.com/2009/02/19/constructor-injection-vs-setter-injection/

IMHO, mixing constructor initialization and setter initialization looks confusing.

  was:
I am adding a third parameter to
{code}
public PDImageXObject(PDDocument document, InputStream filteredStream)
{code}
i.e. changing it to
{code}
public PDImageXObject(PDDocument document, InputStream filteredStream, COSBase cosFilter)
{code}
because in the code, the filter is always set afterwards. My change improves code clarity.
The caller _knows_ what filter was used because he used it to prepare the filteredStream content.

WDYT about also adding width, height, bpc and colorspace to that constructor? These four paramaters
are always used.

This cool guy (enter his name on youtube) has arguments to use constructors parameters instead
of setters:
http://misko.hevery.com/2009/02/19/constructor-injection-vs-setter-injection/

IMHO, mixing constructor initialization and setter initialization looks confusing.


> Add filter parameter to PDImageXObject(document, filteredStream) constructor 
> -----------------------------------------------------------------------------
>
>                 Key: PDFBOX-2068
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2068
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> I am adding a third parameter to
> {code}
> public PDImageXObject(PDDocument document, InputStream filteredStream)
> {code}
> i.e. changing it to
> {code}
> public PDImageXObject(PDDocument document, InputStream filteredStream, COSBase cosFilter)
> {code}
> because in the code, the filter is always set afterwards. My change improves code clarity.
The caller _knows_ what filter was used because he used it to prepare the filteredStream content.
> WDYT about also adding width, height, bpc and colorspace to that constructor? These four
parameters are always used.
> This cool guy (enter his name on youtube) has arguments to use constructors parameters
instead of setters:
> http://misko.hevery.com/2009/02/19/constructor-injection-vs-setter-injection/
> IMHO, mixing constructor initialization and setter initialization looks confusing.



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

Mime
View raw message