pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thad Humphries <thad.humphr...@gmail.com>
Subject Re: Question about CCITTFactory
Date Sun, 19 Feb 2017 13:54:39 GMT
On Sun, Feb 19, 2017 at 4:20 AM, Tilman Hausherr <THausherr@t-online.de>

> Am 18.02.2017 um 17:15 schrieb Thad Humphries:
>> I am processing images, mostly TIFF Group 4, from a repository, and
>> outputting them as PDF. The images *always* come to me in a byte array,
>> never as a file. In fact, I've no option to get it as a file. The
>> repository may or may not be local--it's accessed through its own API.
>> I would like to convert this buffer directly to a PDImageXObject, but both
>> the CCITTFactory.createFromRandomAccess() are deprecated. Why? Looking at
>> the source for the CCITTFactory class, they do the same thing as the
>> createFromFile() methods, which first create a RandomAccessFile before
>> calling createFromRandomAccessImpl().
>> Outside of this project, I've tried CCITTFactory.createFromFile() and seen
>> that it is significantly faster than creating a BufferedImage and calling
>> CCITTFactory.createFromImage(). Possibly it's fast enough to take the hit
>> of writing the TIFF byte array to a temporary file, but why take the hit?
>> So, why are CCITTFactory.createFromRandomAccess() are deprecated?
> That was done in the last commit of
> https://issues.apache.org/jira/browse/PDFBOX-2589
> There was no discussion, probably nobody bothered about it. I assume it
> looked cleaner than this weird RandomAccess thing.
> I'd agree that "The images *always* come to me in a byte array" is a good
> argument to un-deprecate the two methods.
> Please create a new issue in JIRA and copy your argument there. I'll
> undeprecate the methods but will do this after some wait to give John time
> to state his opinion.
> Tilman

Done: https://issues.apache.org/jira/browse/PDFBOX-3696

Thank you.

"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message