Transkribus / TranskribusSwtGui

Note: the repo has been moved to https://gitlab.com/readcoop/Transkribus/TranskribusSwtGui
GNU General Public License v3.0
18 stars 4 forks source link

Exception when selecting region with bad point string format (e.g. including float) #309

Open kahlep opened 4 years ago

kahlep commented 4 years ago

TWI seems to sometimes write floats to the point string and when selecting that region in SwtGui an Exception is thrown (see bottom).

PointStrUtils can already handle this since Transkribus/TranskribusCore@32e3621bba563533c57519add0509e97eda920df

Transkribus/TranskribusCore@4d2975c8374c88059ba49e98fa1077740ccaa4fc adds this fix to PointStrUtils::buildPointContainer but still needs more testing.

16:04:15.060 ERROR [main] eu.transkribus.swt_gui.mainwidget.TrpMainWidget - Error updating selection - Could not update selection from canvas - For input string: "630.2408412483039"
java.lang.NumberFormatException: For input string: "630.2408412483039"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at eu.transkribus.core.util.PageXmlUtils.buildPolygon(PageXmlUtils.java:362)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget.updatePageInfo(TrpMainWidget.java:829)
    at eu.transkribus.swt_gui.canvas.listener.CanvasSceneListener.onSelectionChanged(CanvasSceneListener.java:338)
    at eu.transkribus.swt_gui.canvas.listener.ICanvasSceneListener.triggerEventMethod(ICanvasSceneListener.java:61)
    at eu.transkribus.swt_gui.canvas.CanvasScene.notifyAllListener(CanvasScene.java:1407)
    at eu.transkribus.swt_gui.canvas.CanvasScene.notifyOnSelectionChanged(CanvasScene.java:1252)
    at eu.transkribus.swt_gui.canvas.CanvasScene.selectObject(CanvasScene.java:1052)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget.selectObjectWithData(TrpMainWidget.java:1952)
    at eu.transkribus.swt_gui.transcription.LineTranscriptionWidgetListener.handleSelectionChanged(LineTranscriptionWidgetListener.java:108)
    at eu.transkribus.swt_gui.transcription.ATranscriptionWidgetListener.handleEvent(ATranscriptionWidgetListener.java:116)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5797)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1374)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1400)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1168)
    at eu.transkribus.swt_gui.transcription.ATranscriptionWidget.sendSelectionChangedSignal(ATranscriptionWidget.java:2809)
    at eu.transkribus.swt_gui.transcription.ATranscriptionWidget.updateLineObject(ATranscriptionWidget.java:1608)
    at eu.transkribus.swt_gui.transcription.ATranscriptionWidget.updateLineAndWordObjects(ATranscriptionWidget.java:1618)
    at eu.transkribus.swt_gui.transcription.ATranscriptionWidget$16.handleEvent(ATranscriptionWidget.java:1506)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5797)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1374)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5051)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4583)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget$14.run(TrpMainWidget.java:3040)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget.show(TrpMainWidget.java:2993)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget.show(TrpMainWidget.java:2974)
    at eu.transkribus.swt_gui.mainwidget.TrpMainWidget.main(TrpMainWidget.java:3376)
kahlep commented 4 years ago

fix applied in GUI with 91b07b4f3a84354a8fa100309ebea308fd497bab