NaturalIntelligence / imglab

To speedup and simplify image labeling/ annotation process with multiple supported formats.
https://solothought.com/imglab/
MIT License
988 stars 611 forks source link

Bug: "Alt+a" fails to select all the shapes and result in error #108

Closed amitguptagwl closed 6 years ago

amitguptagwl commented 6 years ago

Describe the bug It is expected that when a user press "Alt+a", all the shapes on the current image should be selected. However it is not happening, and the error on the console is

To Reproduce Steps to reproduce the behavior:

  1. Go to http://imglab.ml/
  2. Import an image and draw some shape
  3. Open console (F12)
  4. Press "Alt+a"

Console Errors

tags/workarea.tag.html.js:276 Uncaught TypeError: Cannot read property 'selectize' of null
    at selectAll (tags/workarea.tag.html.js:276)
    at HTMLDocument.<anonymous> (tags/workarea.tag.html.js:32)
    at HTMLDocument.dispatch (jquery.min.js:3)
    at HTMLDocument.q.handle (jquery.min.js:3)

Additional context The code which cause the issue is;

for (var shapeId in labellingData[imgSelected.name].shapes) {
    var el = SVG.get(shapeId)
    el.selectize({
        rotationPoint: false
    });
    selectedElements.push(el);
};

We're passing index instead of shape id in second line of above snippet.

Watch for changes, or Bookmark for easy discovery. Fund this project for new features and maintenance. [Showcase] your project with us by raising an issue