Closed mzur closed 1 year ago
Is there a reason why deleteKeyFrame in /resources/assets/js/videos/models/Annotation.vue uses 'update' but not 'delete'?
Yes, if you delete a key frame you update the annotation e.g. from this:
points: [[x1,y1],[x2,y2],[x3,y3]]
frames: [a,b,c]
to this:
points: [[x1,y1],[x3,y3]]
frames: [a,c]
So the operation should not delete the whole annotation but only update it (to remove an entry in the points and frames arrays).
Can you explain the if statement in deleteAnnotationOrKeyFrame? If an object tracking annotation should be deleted and the current time is equal to the annotation start time, then only a key frame is deleted. That is the case when the start time is rounded. The whole annotation is deleted, if the annotation start was not rounded, so hasKeyFrame() is false. Is there a reason why you just check the key frames and not also what type of annotation (tracking, whole frame, etc.) should be deleted?
Ah now I understand what's going on. But first to your question:
Is there a reason why you just check the key frames and not also what type of annotation (tracking, whole frame, etc.) should be deleted?
All annotations with isClip
should be treated the same. If a keyframe is selected and Del is pressed, the keyframe should be deleted. And the keyframe is identified by the current time. Besides, "tracking" is not really an annotation type. The result of the object tracking is just a regular multi-frame point/circle annotation.
So here is what I think is going on: The tracking produces a multi-frame annotation. In the video above, I selected the new annotation with a click on the circle (without changing the current time). So when I pressed Del, the first keyframe of the annotation was deleted. But since the annotation was produced with tracking, it's unnoticeable (because the keyframes are so close next to each other). The second time I hit Del, the keyframe for the current time was gone and thus the whole annotation was deleted.
This seems to be no bug after all. Just "unexpected behavior". While the behavior could be improved, I think a solution would be quite complex. So I'd rather just close this. Any objections?
You can close this issue.
I observed a strange issue where a video annotation (with object tracking) was only deleted on the second attempt.
Steps to reproduce:
The annotation will disappear but won't be deleted. It is still visible in the timeline. Instead of a
DELETE
request, aPUT
request is sent (i.e. an update). The annotation is deleted on the second attempt when I click on the delete button in the toolbar.Here is a video that demonstrates the issue. While it shows two annotations, the issue occurs also with a single annotation.
https://github.com/biigle/core/assets/2457311/32b88ba1-addd-4b59-9d56-08c1e8d77bc0