jTessBoxEditorFX - Cannot Handle 600dpi .png Files

落爺英雄遲暮 提交于 2020-01-17 06:21:30

问题


I have a pdf that I have converted to .png at 500dpi and 600dpi. (see below). The 500dpi version works just fine with jTessBoxEditor. But, the 600dpi one fails. I have tried increasing the JVM heap size as suggested here. Even the 600 dpi image is only 91KB. Even when I set the JVM heap size quite large, by running jTessBoxEditor as:

export JAVA_HOME="/Library/Internet Plug-ins/JavaAppletPlugin.plugin/Contents/Home/"  ## necessary to get latest java runtime environment because I am on a mac.
java -Xms1024m -Xmx2048m -jar jTessBoxEditorFX.jar

I still fail to be able to open the 600dpi version. Instead, I get a very long set of errors in the terminal. Some snippets of these are:

java.lang.NullPointerException
    at com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(NGCanvas.java:213)
    at com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:640)
    at com.sun.javafx.sg.prism.NGCanvas.renderContent(NGCanvas.java:603)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)

...

java.lang.NullPointerException
    at com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(NGCanvas.java:213)
    at com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:640)
    at com.sun.javafx.sg.prism.NGCanvas.renderForcedContent(NGCanvas.java:624)
    at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
    at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
    at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
    at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)

...

    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
    at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:477)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:330)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)

The 500dpi image is here:

and the 600dpi image is here:


回答1:


I'm seeing the same thing you did. Unless you need to deal with complex scripts, I suggest you use the non-JavaFX version.



来源:https://stackoverflow.com/questions/38026769/jtessboxeditorfx-cannot-handle-600dpi-png-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!