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

Tilman Hausherr commented on PDFBOX-3163:
-----------------------------------------

The smaller, the better. The initial suggestion was OK but didn't have anything 
for BMP.

PDImageXObject.createFromFile should be renamed to 
PDImageXObject.createFromFileByExt and the new should be named
PDImageXObject.createFromFileByContent, or something similar. The problem is 
that creating by content either means the file must be opened twice, or that we 
need to pass a random access input stream.

> PDImageXObject.createFromFile should relies on header bytes
> -----------------------------------------------------------
>
>                 Key: PDFBOX-3163
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3163
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 2.0.0
>            Reporter: Benjamin Gamard
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> PDImageXObject.createFromFile currently relies on file extension to select 
> the correct factory.
> Often, file extension is not set or not correct.
> It should be better to use the first bytes.
> I did something similar here if it can helps: 
> https://github.com/sismics/docs/blob/master/docs-core/src/main/java/com/sismics/util/mime/MimeTypeUtil.java#L26



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to