Unable to launch...

Discussion about Steve DeVore's Book Scan Wizard, a power-user package to automate scan processing.

Moderator: peterZ

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: Unable to launch...

Post by steve1066d »

I'm interested to see what you come up with.
Steve Devore
BookScanWizard, a flexible book post-processor.
User avatar
rob
Posts: 773
Joined: 03 Jun 2009, 13:50
E-book readers owned: iRex iLiad, Kindle 2
Number of books owned: 4000
Country: United States
Location: Maryland, United States
Contact:

Re: Unable to launch...

Post by rob »

Well, I've determined that it might work, but it would take a lot of work to convert all the JAI Ops you've already defined. I don't know if you're tempted...

The idea was to use ImageMagick as a command-line utility. If you only perform one operation (say, -rotate 90), it's probably not worth it, but once you get into more operations, you can string them all on the command line and it becomes quite fast. Here's an example taking a JPEG image, rotating 90 degrees, auto level, and thresholding all pixels below 100 to black, and re-encoding as JPEG-2000:

Code: Select all

$ time convert cover.jpg -rotate 90 -auto-level -black-threshold 100 -quality 100 cover2.jp2

real    0m1.522s
user    0m1.483s
sys     0m0.185s
And since ImageMagick is available on OSX, Windows, Linux, and Solaris (does anybody really use Solaris anymore?), you wouldn't have to rely on the JAI and work around all those wacky bugs. Well, you might have to use JAI to read the images in the first place. Or you could always use ImageMagick to read the image and output in raw RGB samples (along with printing the width and height, since raw RGB doesn't store that data). That would totally kick JAI to the curb.
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
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: Unable to launch...

Post by steve1066d »

I was thinking about your suggestion, and you could pretty much do that right now. The PipePNG command lets you uses imagemagik wherever you want. If you wanted it to handle saving the file as well you'd have to use "SaveImage none" to keep BSW from creating a tiff file.

When I've experimented with it, It does seem to really slows things down though. There's a pretty big hit to save off an image and load it back to Java. If I could call it from JNI to save that cost I think it would be more feasible, but that approach is pretty buggy.

Though I guess if I load the file originally from imagemagik and do everything within Imagemagik it might be fast enough.

I've got some ideas on some more hooks to make this sort of processing easier, but I don't know if it could could entirely replace jai.
Steve Devore
BookScanWizard, a flexible book post-processor.
User avatar
n9yty
Posts: 72
Joined: 25 Jul 2010, 22:13

Re: Unable to launch...

Post by n9yty »

steve1066d wrote:Ok.. I think I figured it out.. Evidently OSX requires ImageIO.scanForPlugins() to work right.

Write once, run anywhere... yeah.

Anyways, I've updated the code to 1.1c to fix this issue.

Edit: Just heard from a mac user that it indeed fixed the problem.
Sorry, was this meant to say the problem was fixed in the current downloadable version? I still get the error. I have not downloaded different versions of JAI, ImageIO, etc., I just have the stock stuff that comes with Mac OS X 10.6.

Code: Select all

Exception in thread "main" java.lang.ExceptionInInitializerError
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at net.sourceforge.bookscanwizard.OperationList.<init>(OperationList.java:102)
	at net.sourceforge.bookscanwizard.MainFrame.<init>(MainFrame.java:366)
	at net.sourceforge.bookscanwizard.BSW.<init>(BSW.java:224)
	at net.sourceforge.bookscanwizard.BSW.main(BSW.java:177)
Caused by: java.util.NoSuchElementException
	at javax.imageio.spi.FilterIterator.next(ServiceRegistry.java:808)
	at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:816)
	at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:801)
	at net.sourceforge.bookscanwizard.op.CreateArchiveZip.<clinit>(CreateArchiveZip.java:52)
	... 10 more
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: Unable to launch...

Post by steve1066d »

Yes, that problem should be fixed...

Are you using the webstart version?

What version do you see when you choose Help, About?
Steve Devore
BookScanWizard, a flexible book post-processor.
User avatar
n9yty
Posts: 72
Joined: 25 Jul 2010, 22:13

Re: Unable to launch...

Post by n9yty »

steve1066d wrote:Yes, that problem should be fixed...
Are you using the webstart version?
No, I am using the download standalone version. The webstart version did work now that you mention it, but I like standalone. :)
What version do you see when you choose Help, About?
I can't get it to launch, no hope of doing a Help->About. LoL
Post Reply