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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]