Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

back to bsw with new crop rectangle problem

Discussion about Steve DeVore's Book Scan Wizard, a power-user package to automate scan processing.
Post Reply
DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

back to bsw with new crop rectangle problem

Post by DanE » 28 Apr 2015, 19:08

Hi,

I have 17 tiffs with 2-up page images. I followed the sample comfig you posted:
# Book Scan Wizard Script
# http://bookscanwizard.sourceforge.net
# C:\Users\essin


# *** Load Files ***
# the source directory
LoadLRImages = C:\bsw\tiffs

# Override source DPI
SetSourceDPI = 300

# The Destination directory
SetDestination = C:\bsw\pdf

# *** Page Rotations ***
Pages = left
Pages = right

# *** Remove Pages ***
# *** Perspective ***
Pages = left
Crop = 15,15, 2836,4593
Pages = right
Crop = 5565,4622, 2793,0
# *** Filters ***
Color = gray
Levels = 59 60

#Change to a binary (black & white) image, with a clipping point of 60%
Color=bw 60

# *** Scaling ***
Pages = all
# Rescale the image to match the final DPI
ScaleToDPI=300

# This will ensure the left and right pages are exactly the same size.
ScaleToFirst=

# *** Output ***
Pages=all
CreatePDF = essin.pdf


Everything seems to preview ok. there are no blank crop areas and the right hand sidebar contains 34 images.
When I submit I get:
ScaleToDPI source dpi matches destination dpi. Skipping this step
CreatePDF Creating C:\bsw\pdf\essin.pdf
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Crop The rectangular crop area must not be empty.
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at net.sourceforge.bookscanwizard.BSW$4.run(BSW.java:471)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Crop The rectangular crop area must not be empty.
at javax.media.jai.JAI.createNS(JAI.java:1087)
at javax.media.jai.JAI.create(JAI.java:973)
at javax.media.jai.JAI.create(JAI.java:1395)
at net.sourceforge.bookscanwizard.op.Crop.performOperation(Crop.java:84)
at net.sourceforge.bookscanwizard.Operation.performOperations(Operation.java:376)
at net.sourceforge.bookscanwizard.BSW.processFile(BSW.java:522)
at net.sourceforge.bookscanwizard.BSW.access$400(BSW.java:72)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:411)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:408)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
javax.imageio.IIOException: Inconsistent metadata read from stream

I'm at a loss for how to interpret this or how to fixit.

Can you help?

Thanks,
Dan

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: back to bsw with new crop rectangle problem

Post by DanE » 28 Apr 2015, 19:36

more info...
I reduced the input to a single tiff. The same error is generated. the crop boxes on both sides of the page look fine in preview.

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: back to bsw with new crop rectangle problem

Post by DanE » 28 Apr 2015, 20:00

The problem is that the crop for the right hand side of the page is being applied to what is left after the crop of the left hand side, which is nothing since the right side has already been discarded by the left hand crop. Somehow the process needs to preserve the image of the entire page so there will be something for the right hand crop to be applied to.

I have verified this be making the second crop fit within the borders of the first crop. It then works without error. See attached before and after
Attachments
essin.pdf
after
(33.16 KiB) Downloaded 480 times

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: back to bsw with new crop rectangle problem

Post by DanE » 28 Apr 2015, 20:01

before
Attachments
Page_01.jpg
before

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

Re: back to bsw with new crop rectangle problem

Post by steve1066d » 13 May 2015, 08:01

Dan,

Try changing the crop from:

Crop = 5565,4622, 2793,0

to

Crop = 2793,0, 5565,4622
Steve Devore
BookScanWizard, a flexible book post-processor.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests