fix: install JAI Image I/O JPEG2000 plugin for PDFBox#8
Open
ferblape wants to merge 1 commit into
Open
Conversation
PDFBox failed to rasterize PDF pages with JPEG2000-encoded image streams, logging "Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed" and skipping OCR on those pages. Drop the jai-imageio-core and jai-imageio-jpeg2000 JARs into /tika-extras/, which the apache/tika base image already includes on the server classpath, so the J2KImageReaderSpi is auto-discovered via the ImageIO ServiceLoader.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installedand silently skipping OCR on PDF pages whose images use JPEG2000 (JPX) streams — common in Spanish/Catalan/Basque admin scans.jai-imageio-coreandjai-imageio-jpeg2000(v1.4.0) into/tika-extras/, which theapache/tika:latest-fullentrypoint already includes on the server classpath, soJ2KImageReaderSpiis auto-discovered via the ImageIO ServiceLoader.Test plan
docker buildsucceeds againstapache/tika:latest-fulldocker inspectconfirms/tika-extras/*is on the entrypoint-cpMETA-INF/services/javax.imageio.spi.ImageReaderSpiregisteringcom.github.jaiimageio.jpeg2000.impl.J2KImageReaderSpi/detectand/metareturnsimage/jp2with noMissingImageReaderExceptionin logs