Page 1 of 1

back to bsw with new crop rectangle problem

Posted: 28 Apr 2015, 19:08
by DanE
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

Re: back to bsw with new crop rectangle problem

Posted: 28 Apr 2015, 19:36
by DanE
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.

Re: back to bsw with new crop rectangle problem

Posted: 28 Apr 2015, 20:00
by DanE
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

Re: back to bsw with new crop rectangle problem

Posted: 28 Apr 2015, 20:01
by DanE
before

Re: back to bsw with new crop rectangle problem

Posted: 13 May 2015, 08:01
by steve1066d
Dan,

Try changing the crop from:

Crop = 5565,4622, 2793,0

to

Crop = 2793,0, 5565,4622