informatics-isi-edu / openseadragon-viewer

2D viewer with openseadragon
Apache License 2.0
5 stars 2 forks source link

Empty elemets while adding new annotation #26

Closed rastogi-bhavya closed 1 year ago

rastogi-bhavya commented 4 years ago

While adding a new annotations, empty elements are created. This should not happen.

`<svg viewBox=‘0 0 17451 18493’ color=‘#DD57AA’ xmlns=‘http://www.w3.org/2000/svg’ xmlns:xlink=‘http://www.w3.org/1999/xlink’>

` Here the second `rect` is created which is correct.
rastogi-bhavya commented 4 years ago

Current fix is a check while creating the output SVG. While creating the file, I am checking to see if each component has necessary features needed for it to be drawn. For eg, to draw a rectangle you need x, y, height, width. If any of this is not present it cannot be drawn.

The proper fix would be to not allow such a component to be created.

rastogi-bhavya commented 4 years ago

Empty SVG files should not be created. Example: if the user clicks on a drawing tool and clicks on the image and then clicks on save, an empty svg file (file having no elements like path, rect) is created and stored into the DB. When the page is reloaded this empty file is displayed in the annotations on the left hand side but there is no annotation drawn.

RFSH commented 4 years ago

@rastogi-bhavya If this is not something that you're actively working on, change the pipeline to "this month". The bug is "fixed" and the rest of the changes that you described in your comment is just improvement for the code.

RFSH commented 1 year ago

The empty annotation is created when users start a drawing event, and we're making sure to remove it if it remains empty (user clicks on a drawing tool and never draws anything). So I'm going to close this issue.