Added xpath method for obtaining image when normal fails
This commit is contained in:
@@ -43,7 +43,7 @@ def create_image(product_id, price):
|
||||
try:
|
||||
product_image = Image.open(f"/app/data/images/products/{product_id}.jpg")
|
||||
except:
|
||||
product_image = Image.open(f"/app/data/images/placeholder.jpg")
|
||||
product_image = Image.open(f"/app/data/images/placeholder.png")
|
||||
hpercent = (baseheight / float(product_image.size[1]))
|
||||
wsize = int((float(product_image.size[0]) * float(hpercent)))
|
||||
if wsize < wlimit:
|
||||
|
||||
Reference in New Issue
Block a user