Page 1 of 1

Watermark images during upload

Posted: Fri Jan 05, 2018 1:57 am
by praf

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.


Re: Watermark images during upload

Posted: Fri Jan 05, 2018 11:49 am
by arbei

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.


Re: Watermark images during upload

Posted: Thu Jan 11, 2018 3:47 am
by praf

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.