Docker container
Hey, seems like a great project but I've had a hell of a time getting jbig2enc to compile on Debian Testing. A docker file would really help users wade through some of the dependencies. Thanks.
Glancing at my own documentation I seem to have forgotten to mention build-essential (nerdview, sorry ;-) ) and libpng12-dev has been superseded by libpng-dev. So updated that gets you:
sudo apt install build-essential automake autotools-dev libtool libleptonica-dev libjpeg8-dev libpng-dev libtiff5-dev zlib1g-dev
I actually think of pdfbeads as the problematic one. All in all djvubind is a lot better.
Another alternative is to create horribly large PDFs and optimize them afterwards, cf. https://www.diybookscanner.org/forum/viewtopic.php?t=787 (which I just found and unfortunately only just now made me aware of the really interesting looking https://github.com/Blender3D/Bindery)
Right, but Docker — I know nothing about it. Perhaps you could submit a PR?
Thanks for your reply. It seems that I'm still caught in a dependency mess: libtiff5-dev depends on libjpeg-dev but libjpeg-dev conflicts with libjpeg8-dev. This is probably obvious, sorry.
Your first link looks dead. I'll have to look more closely at Bindery. Looks interesting. Djvu is a Microsoft format, no?
I've never created anything with Docker and I probably couldn't do anything immediately but if I can get this running, I'll see if I can knock something together at some point.
Thanks for your help.
Looks like you can just leave that one out in Stretch. But the list of dependencies is just a convenience to save you the trouble of figuring them out for yourself. In principle you just run ./autogen.sh and ./configure and that should tell you if anything's missing. The main thing to remember is that if it tells you package X is missing it actually means X-dev.
So more accurately phrased, what you need is the stuff for building (this'll be the same on pretty much any version of Debian and its derivatives):
sudo apt install build-essential automake autotools-dev libtool
Only after installing those packages will you be able to successfully run ./autogen.sh, which in turn will generate a ./configure relevant to your system. The error messages generated by ./configure coupled with the README or INSTALL file should help you quickly figure out which development dependencies you need. For Stretch that should be:
libleptonica-dev libpng-dev libtiff5-dev zlib1g-dev
Finally, as I already alluded to above, always make sure to check the official README or INSTALL files lest the instructions written by some random guy on the Internet (like me) are outdated. Oh yeah, and if you use a package in a Vagrant/Docker/whatever container you should pull a specific Git commit or tag or it will break in the future.
I wonder if there even are any Microsoft programs that can handle DjVu. :-P DjVu is something that doesn't require extensive messing around in Linux/Debian like PDF does, which I don't think applies to anything MS-related though I could be mistaken. Wikipedia says it came from AT&T before it was GPL-ed. The DIY Book Scanner forum was working a couple of days ago as well as pretty much the entire past half decade, so I guess it's just an issue today.
Actually this script grew a lot more complicated because I decided I wanted PDF, but conceptually there are two or three parts to it.
- Extracting images from a scanned PDF (a little scripting around pdfimages).
- Automatically processing those images with Scan Tailor.
- Making them into a PDF (includes OCR).
Part 3 in particular is really more of a separate affair. djvubind also incorporates OCR by itself. Then again, it might be rather useful to generate both a PDF and a DjVu (using djvubind). Similarly I've got my abcde set up to spit out FLAC, Opus and MP3.
As a minor update, I've become fairly well-versed in Docker since this issue was opened. jbig2enc is included in the Alpine repos, so a Docker image would need literally nothing but apk add jbig2enc. The downside is of course that it'd require Docker, but that's still likely to be easier than compiling dependencies.
Hey, glad to see you're still maintaining this--I'm certainly still using it on a regular basis. I had forgotten about this thread, though. I haven't tried rebuilding it recently, so no idea if it's become more cumbersome. If it's fairly straightforward, a Docker image would be great. I'd be happy to test it.
Incidentally, I'm not sure if you've seen this: https://github.com/4lex4/scantailor-advanced. (I haven't had a chance to play with it, but it looks interesting.)
I hadn't noticed, thanks.