It seems that the Python method, insert_image, in the xlsxwriter module fails to properly scale images once they become too large (e.g. 3840 pixels wide).
The following code should insert images into the Excel worksheet at 7.5 columns wide. However, the images come in at ~1.25 columns wide.
The sample code works for images that are 1328 and 1920 pixels wide. Does anyone know why insert_image doesn't scale large images correctly?
with xlsxwriter.Workbook('SampleFile.xlsx') as workbook:
worksheet=workbook.add_worksheet()
cell_width=64.0
image_width=3840.0
cols_wide=7.5
scale = cell_width*cols_wide/image_width
worksheet.insert_image('B2', 'SampleImage.png',
{'x_scale': scale, 'y_scale': scale})