JamzTheMan / TokenTool

A Token creation tool to create png images suitable for Virtual Table Tops. Now infused with Nerps!

Home Page:http://tokentool.nerps.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in pdf-extract-feature branch

Azhrei opened this issue · comments

This is on macOS Sierra (one revision back from current) with Java 9 both as the Eclipse runtime and the project target (only JDK installed). This exception occurred five times.

java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:662)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at com.github.jaiimageio.impl.common.ImageUtil.processOnRegistration(ImageUtil.java:1401)
	at com.github.jaiimageio.impl.plugins.wbmp.WBMPImageReaderSpi.onRegistration(WBMPImageReaderSpi.java:96)
	at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:788)
	at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:330)
	at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:212)
	at java.desktop/javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:136)
	at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:157)
	at net.rptools.tokentool.client.TokenTool.init(TokenTool.java:84)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:897)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
	at java.base/java.lang.Thread.run(Thread.java:844```

Dropping a PDF into the portrait window cleared the existing image but otherwise was non-effectual.  When closing TT, the following exception was reported (I'm including other startup messages as well).

```19:51:47.476 (AppSetup.java:48) [JavaFX-Launcher] INFO  - Overlays installed: 55
19:51:47.480 (TokenTool.java:93) [JavaFX-Launcher] INFO  - 3D Hardware Available? true
19:51:48.193 (AppPreferences.java:161) [JavaFX Application Thread] INFO  - Restoring preferences...
19:51:49.073 (AppPreferences.java:201) [JavaFX Application Thread] INFO  - Restoring window position x, y: 781.0, 23.0
2018-01-10 19:52:14.388 java[84653:8044948] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x7ff4e7a041d0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
19:52:32.338 (AppPreferences.java:97) [JavaFX Application Thread] INFO  - Saving preferences...
19:52:32.342 (TokenTool_Controller.java:1176) [JavaFX Application Thread] ERROR - Error saving preferences!
java.lang.IllegalArgumentException: image == null!
	at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(ImageTypeSpecifier.java:925) ~[?:?]
	at javax.imageio.ImageIO.getWriter(ImageIO.java:1608) ~[?:?]
	at javax.imageio.ImageIO.write(ImageIO.java:1540) ~[?:?]
	at net.rptools.tokentool.AppPreferences.savePreferences(AppPreferences.java:140) ~[bin/:?]
	at net.rptools.tokentool.controller.TokenTool_Controller.exitApplication(TokenTool_Controller.java:1174) ~[bin/:?]
	at net.rptools.tokentool.controller.TokenTool_Controller.fileExitMenu_onAction(TokenTool_Controller.java:396) ~[bin/:?]```
commented

It's a know issue with the image io lib. They are looking for Java version 1.x but in Java 9 they dropped the 1.

And you can't drop a PDF. Use File open PDF.

commented

Mmm also an error on saving preferences, will need to look into that...

commented

Ok, you can drop PDF files now and it'll open them...

Also, the imageio lib has been updated so doesn't throw an error using Java 9+ anymore.