Closed valentinitnelav closed 1 year ago
Saving the file as xlsm didn't solve the problem
I also changed how I defined coords from
coord = [x0, y0, x1, y1]
But didn't fix it to
coord = [(x0, y0), (x1, y1)]
Ok, so the problem is that it can happen that the coordinates are read as text, to fix this, convert them to integer.
So, in https://github.com/valentinitnelav/img-with-box-from-excel/blob/main/src/boxcel/display_images.py, replace
x0 = df['x'][0]
y0 = df['y'][0]
x1 = df['x'][0] + df['width'][0]
y1 = df['y'][0] + df['height'][0]
with
x0 = int(df['x'][0])
y0 = int(df['y'][0])
x1 = x0 + int(df['width'][0])
y1 = y0 + int(df['height'][0])
Not sure at the moment why this is happening.
File: dt_annotations_with_cor_plants_2023_04_20.xlsx Note that this doesn't happen at the moment with hymenoptera_Demetra.xlsm. Check why - is it the file type?