I'm unable to save the image that is either being resized or uploading directly through my admin
panel. I want to resize it through PLP
or any other way!
def get_product_image_folder(instance, filename):
return "static/images/product/%s/base/%s" %(instance.product_id, filename)
product_image = StringIO.StringIO(i.read())
imageImage = Image.open(product_image)
thumbImage = imageImage.resize((100,100))
thumbfile = StringIO()
thumbImage.save(thumbfile, "JPEG")
thumbcontent = ContentFile(thumbfile.getvalue())
newphoto.thumb.save(filename, thumbcontent)
new_photo.save()