rasvaan / accurator

Accurator cpack
7 stars 3 forks source link

Debug saving targets #211

Closed rasvaan closed 8 years ago

rasvaan commented 8 years ago

Debug the following code within submitAnnotation. Investigate if always sending the uri of the ch object as target is appropriate (in context of the following line: if (targetImage && target != targetImage)).

var targetObject = null;
    if (this._anno && this._anno._deniche.currentShape) {
        var shape = this._anno._deniche.currentShape.geometry;
        var targetImage = this.targetImage;

        if (targetImage && target != targetImage) {
            // Another annotation on selector with existing id (target id is the selector, not the image)
            targetObject = [{hasSource:targetImage, hasSelector:{value:shape}}, {'@id':target}];
        } else {
            // Annotation on new selector, id will be generated server-side
            targetObject = [{hasSource:target, hasSelector:{value:shape}}];
        }
    } else {
        // Annotation without fragment, on entire target image
        targetObject = [{'@id':target}];
    }