temporarily adding watermark image/copyright text while displaying image in django template

288 Views Asked by At

I am creating a stock photo site. I need to add watermark temporarily while displaying in django template so that user shouldn't be able to download original photo without purchasing. I've tried django-watermark but got error while migrating. python 3.8+ and django 3.1.3+

So far I've overlapped images using this code,

water_mark_image = Image.open(settings.MEDIA_ROOT+'/water.png')
water_mark_image = wat.resize((int(im.width/2), int((im.width/2)*(h/w))))
Original_image.paste(wat, (int((im.width-wat.width)/2), int((im.height-wat.height)/1)), mask=wat)

but while downloading image comes along with watermark. I dont want to save duplicate image. Please suggest me a way to add watermark temporarily while displaying in detail.

0

There are 0 best solutions below