I am trying to add a resized photo into a excel file using openpyxl module for python i am using the following code but didnt work... only adds the photo (not resized) from the specified cell.
import openpyxl
from openpyxl import load_workbook
from openpyxl import Workbook
wb = load_workbook('file.xlsx')
ws = wb.active
img = Image.open('photo.jpg')
nimg = img.resize((140,92))
img=openpyxl.drawing.image.Image('photo.jpg')
ws.add_image(img, 'F2') #where F2 is the cell where i want to add the photo
wb.save('test.xlsx')
I also tried to open the image with PIL but when i want to give the resized image as a parameter i`ve got some errors..
import openpyxl
from PIL import Image
from openpyxl import load_workbook
from