Closed mzur closed 8 months ago
I don't think this can happen, because of this check here.
Array $u
and $v
both have the same length, because the (tilted) vector $v
is projected on the x-axis which is $u
. If $v
is equal to $u
(there is no rotation), skip the computation and return zero.
But I agree that there is still something to do, because I compute the length twice for both vector. I will change that.
I can just tell you that this error happened a couple of hundred times since I deployed the feature on Friday :smiley: I will look up an example rectangle with coordinates.
Ah okay. Then I will fix it. Sorry, I couldn't reproduce it and thought you mean that there is maybe just the possibility that this error could occur.
Here are the coordinates of a rectangle that caused the error:
[844.69,1028.44,844.69,1028.44,844.69,1028.44,844.69,1028.44]
Sorry, I couldn't reproduce it and thought you mean that there is maybe just the possibility that this error could occur.
No worries. Of course you can't fix an error that you can't reproduce.
The the points of the recangle above are all the same. That's probably the issue. Please also add a test case for this.
Seems like someone is having a really hard time drawing correct rectangles. I've created https://github.com/biigle/core/issues/763 as a follow-up.
There can be a DivisionByZeroError here:
https://github.com/biigle/largo/blob/c322781a429609ff27a5a2ea2d7baf57edfda685/src/Jobs/ProcessAnnotatedFile.php#L426
@lehecht Can you please look into this?