You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Marcus Linder <Ma...@cas.de> on 2024/08/27 07:53:37 UTC
Compatibility between Apache PDFBox and de.digitalcollections.imageio
Hello,
we are using PDFBox version 3.0.0
We are trying to read JPEG2000 images embedded in PDFs using the ImageIO plugins from de.digitalcollections.imageio.
For license reasons we are not allowed to use the plugin of jai-imageio-jpeg2000.
The problem:
When debugging the readJPX() method of the JPXFilter.java class from the org.apache.pdfbox.filter package, we noticed that the image is only read via the
reader.read() method.
Nevertheless, the reader also checks whether the canReadRaster() function is fulfilled (in our opinion, this is not necessary for what is done with the reader afterwards).
This is done in the first line of the readJPX() method by calling the findImageReader() method of the Filter.java class. This calls the aforementioned canReadRaster() method of the abstract class ImageReader.java, which returns false by default.
Our reader (that of the de.digitalcollections.imageio plugin mentioned above) does NOT overwrite the canReadRaster() method, so the false of the super class is returned and the reading process is aborted.
As already mentioned above, we wonder about the call of the canReadRaster() method and the necessity for the further reading process.
Best regards,
Marcus Linder
Re: Compatibility between Apache PDFBox and de.digitalcollections.imageio
Posted by Tilman Hausherr <TH...@t-online.de>.
Hello,
This has been fixed in
https://issues.apache.org/jira/browse/PDFBOX-5872
however it hasn't been released. You can get a snapshot here:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.4-SNAPSHOT/
Tilman
On 27.08.2024 09:53, Marcus Linder wrote:
> Hello,
>
> we are using PDFBox version 3.0.0
> We are trying to read JPEG2000 images embedded in PDFs using the ImageIO plugins from de.digitalcollections.imageio.
> For license reasons we are not allowed to use the plugin of jai-imageio-jpeg2000.
>
> The problem:
> When debugging the readJPX() method of the JPXFilter.java class from the org.apache.pdfbox.filter package, we noticed that the image is only read via the
> reader.read() method.
>
> Nevertheless, the reader also checks whether the canReadRaster() function is fulfilled (in our opinion, this is not necessary for what is done with the reader afterwards).
> This is done in the first line of the readJPX() method by calling the findImageReader() method of the Filter.java class. This calls the aforementioned canReadRaster() method of the abstract class ImageReader.java, which returns false by default.
>
> Our reader (that of the de.digitalcollections.imageio plugin mentioned above) does NOT overwrite the canReadRaster() method, so the false of the super class is returned and the reading process is aborted.
> As already mentioned above, we wonder about the call of the canReadRaster() method and the necessity for the further reading process.
>
> Best regards,
> Marcus Linder
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org