Open bicachu opened 6 months ago
Sorry @bicachu there currently isn't support for images.
This feature could be added though. Excelbird uses openpyxl
for the lower level implementation of writing data to xlsx files. So if we introduced a simple Image
type that just stores a file path or bytes, we could accept this as an argument (similar to your example) and handle it under the hood using openpyxl.drawing.image.Image
to write the data.
Thanks @ryayoung - is there a way to add inside an Excelbird Sheet or Cell container? Looking at the documentation for openpyxl - working with images, it requires a worksheet instance to be set first such that
wb =. Workbook()
ws = wb.active
ws.add_image(img, 'A1')
Is there a way to easily do this within an existing excelbird Sheet
declaration or does the Sheet
class needed to be changed to add such an attribute such an add image function
Is there a way or syntax to convert and insert an image somewhere into a sheet? I tried to do this as follows but am getting the following error with converting the JPEG to a readable format to Excel:
ValueError: Cannot convert <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=129x120 at 0x124B1CDD0> to Excel
Sample code