0
Started

Compression on pdf scans in Ubooquity3

Anne 9 months ago updated by Tom 8 months ago 4

I have a number of pdf scans that seem to be having a compression or scan issue with Ubooquity3. I have a suspicion that it has to do with this error:

ERROR o.a.p.contentstream.PDFStreamEngine -  Cannot read JBIG2 image: jbig2-imageio is not installed

Is there anything I can do from my end to fix this issue on my PDF scans?

I'm torn between loving the new version of Ubooquity, but not being able to read a lot of my books due to this PDF scanning weirdness.

Answer

Answer
Started

Thanks to the file you sent me I was able to reproduce the issue and fix it. 

The fix will be in the next minor verion (3.0.3). :)

I looked into this further and it calls jbig2-imageio to process any PDFs that are/have jbig2 format within them. I am not sure what changed between the versions, but I was able to get it to work by running Ubooquity with 'java -cp Ubooquity.jar:jbig2-imageio-3.0.4.jar com.ubooquity.Launcher --headless --remoteadmin'.
Maybe either the rewrite to kotlin or the pdfbox upgrade? Idk, just sharing what I have.

Under review

Indeed, looks like a dependency issue.

I didn't change anything around this lib recently, but there must be some side effect, perhaps from the Java version increase (8 to 17 was a pretty big jump).

I'll look at it so that it's fixed in the next update.

Thanks for the investigation, it helps a lot. :)

I could not find a PDF containing a jbig2 image in my collection (I seem to have lost the one I used to test my implementation a few years ago).

Would have one that could be shared (or sent to tom at vamendis.net) so that I can use it to reproduce the issue on my side ?

Answer
Started

Thanks to the file you sent me I was able to reproduce the issue and fix it. 

The fix will be in the next minor verion (3.0.3). :)