Skip to content

Commit 1b7eeb1

Browse files
Merge pull request #215 from SenteraLLC/fix/empty-layers
Fix/empty layers
2 parents 6b8c9b1 + cc07d14 commit 1b7eeb1

9 files changed

Lines changed: 20 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ All notable changes to this project will be documented here.
66

77
Nothing yet.
88

9+
## [0.16.4] - May 2nd, 2025
10+
- Fix bug where empty polygon layers could be included in a `submit_button` hook payload.
11+
912
## [0.16.3] - Apr 25th, 2025
1013
- Fix bug where the `Vanish` button wouldn't update its `locked` state when switching between subtasks.
1114
- Fix bug where clicking the `Vanish` button would unexpectedly set the size cookie, causing future annotations in the same subtask to be loaded in a very small size on subsequent sessions, with the only way to recover being to increase the annotation size.

demo/resume-from.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@
172172
467.5,
173173
267.5
174174
]
175-
]
175+
],
176+
[]
176177
],
177178
"classification_payloads": [
178179
{

dist/ulabel.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ulabel.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ulabel",
33
"description": "An image annotation tool.",
4-
"version": "0.16.3",
4+
"version": "0.16.4",
55
"main": "dist/ulabel.js",
66
"module": "dist/ulabel.js",
77
"scripts": {

src/annotation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class ULabelAnnotation {
129129
const layer = this.spatial_payload[i];
130130
// Ensure that the layer is an array
131131
if (!Array.isArray(layer[0])) {
132-
console.log(`Layer ${i} points of id ${this.id} are not arrays. Removing layer.`);
132+
console.log(`Layer ${i} of id ${this.id} has an invalid or empty point array. Removing layer.`);
133133
indices_to_remove.push(i);
134134
continue;
135135
}

src/toolbox.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,15 @@ export class SubmitButtons extends ToolboxItem {
24842484
submit_payload["annotations"][stkey] = [];
24852485

24862486
// Add all of the annotations in that subtask
2487+
let annotation: ULabelAnnotation;
24872488
for (let i = 0; i < ulabel.subtasks[stkey]["annotations"]["ordering"].length; i++) {
2488-
const annotation = ulabel.subtasks[stkey]["annotations"]["access"][ulabel.subtasks[stkey]["annotations"]["ordering"][i]];
2489+
try {
2490+
annotation = ULabelAnnotation.from_json(ulabel.subtasks[stkey]["annotations"]["access"][ulabel.subtasks[stkey]["annotations"]["ordering"][i]]);
2491+
} catch (e) {
2492+
console.error("Error validating annotation during submit.", e);
2493+
continue;
2494+
}
2495+
24892496
// Skip any delete modes
24902497
if (
24912498
DELETE_MODES.includes(annotation.spatial_type)

src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const ULABEL_VERSION = "0.16.3";
1+
export const ULABEL_VERSION = "0.16.4";

0 commit comments

Comments
 (0)