R
R
Rostislav2016-12-22 11:40:59
Watermark
Rostislav, 2016-12-22 11:40:59

How to write a small plug-in for image compression and watermarking on the fly (php GD) under Wordpress?

There are enough plugins, but they are either paid or do not meet my requirements.
The point is this.
1) When uploading images through the "Media Files" menu in the admin panel, they are automatically compressed (so that google pagespeed does not swear).
2) When displaying a page on images, a watermark is set using php.
Let me show you how to do it. We cling to some kind of hook / filter, look for all the images, set up a watermark, send it to the output.
Images are displayed on the product page using the Advanced Custom Fields plugin (allows you to select the desired images for a specific article) + Slick Slider (displays image data in the form of a slider).
I 'm interested in a few points:
1) What hook / filter can I attach to?
I thought that the_content would help, but it only displays the content of the page, but how to get images for the slider?
2) How much will the page display slow down if a watermark is created before the article is displayed on images (4-6 pieces, approximately 500x500)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A person from Kazakhstan, 2016-12-22
@LenovoId

www.blogzor.ru/nalozhenie-vodyanyx-znakov-s-pomosh...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question