Watermark images during upload

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.

Watermark images during upload

Postby praf » Fri Jan 05, 2018 1:57 am

Hi
I would like to put watermark on images that get uploaded. The image should only get watermarked once, so I guess just after successful upload of the image? I have the php code to add the watermark to the image. What is the best place to execute the function.
Thanks.
praf
 
Posts: 7
Joined: Thu Jun 23, 2016 8:41 pm

Re: Watermark images during upload

Postby arbei » Fri Jan 05, 2018 11:49 am

You can use the Row_Inserted or Row_Updated Server Event and update the corresponding files.

In the above Server Event, the records are updated and the image is uploaded to the upload folder with the corresponding file name in $rsnew.

Read help file topic: "Server Events and Client Scripts" -> "Row_Inserted" and "Row_Updated" for more information.
arbei
 
Posts: 1499
Joined: Wed Sep 09, 2015 10:13 am

Re: Watermark images during upload

Postby praf » Thu Jan 11, 2018 3:47 am

Thanks. Managed to do this with both the server events.

FYI
My app is set for multiple file upload and max size option in phpmaker. There is an issue if there are lot of files being uploaded - the resize process (and watermarking) on save fails to complete. I had to increase the PHP execution timeout on the page to overcome this.
praf
 
Posts: 7
Joined: Thu Jun 23, 2016 8:41 pm


Return to General Discussion (PHPMaker)