Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

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

Open
kahlep opened this issue Jul 23, 2020 · 1 comment

Comments

@kahlep
Copy link
Contributor

kahlep commented Jul 23, 2020

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@32e3621

Transkribus/TranskribusCore@4d2975c 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
Copy link
Contributor Author

kahlep commented Jul 24, 2020

fix applied in GUI with 91b07b4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant