Skip to content

Commit 686a18f

Browse files
authored
Update xlsx.py (#25)
worksheet.insert_image(row, cols.index(col), file, {'y_offset' : col_height-height} moved to "Try" some line up worksheet.write_url(row, cols.index(col)+1, os.path.join(basepath,file), string="Link to picture") added in "Except" if pictures can be not embedded
1 parent 3aa604d commit 686a18f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pyreqif/xlsx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ def write_excel_line(worksheet, item, row, cols, depth, basepath, format):
5454
_, height = im.size
5555
col_height += height
5656
im.close()
57+
worksheet.insert_image(row, cols.index(col), file, {'y_offset' : col_height-height}
5758
except:
5859
print("Error with image: {}".format(file))
60+
worksheet.write_url(row, cols.index(col)+1, os.path.join(basepath,file), string="Link to picture")
5961
col_height = max(300, row_height)
6062

61-
if file[-3:].lower() in ["png", "jpeg", "jpg", "bmp", "wmf", "emf"]:
62-
worksheet.insert_image(row, cols.index(col), file, {'y_offset' : col_height-height})
6363
row_height = max(row_height, col_height)
6464
if row_height == 0:
6565
worksheet.set_row(row, None, format, {'level': depth})

0 commit comments

Comments
 (0)