|
@ -15,7 +15,7 @@ try: |
|
|
im = Image.open(infile) |
|
|
im = Image.open(infile) |
|
|
im_watermark = Image.open(watermark) |
|
|
im_watermark = Image.open(watermark) |
|
|
im = im.convert() |
|
|
im = im.convert() |
|
|
im.paste(im_watermark, (im.size[0] // 2 - im_watermark.size[0] // 2, im.size[1] // 2 - im_watermark.size[1] // 2)) |
|
|
|
|
|
|
|
|
im.paste(im_watermark, (im.size[0] // 2 - im_watermark.size[0] // 2, im.size[1] // 2 - im_watermark.size[1] // 2), im_watermark) |
|
|
im.save(infile, "JPEG", quality=100) |
|
|
im.save(infile, "JPEG", quality=100) |
|
|
except IOError: |
|
|
except IOError: |
|
|
print("cannot create thumbnail for '%s'" % infile) |
|
|
print("cannot create thumbnail for '%s'" % infile) |