Hello, this time I've a question about creating watermarks. I want to open pictures from gallery thumbs in a lightbox (lightbox2) and want them to show a watermark.
I found a php script how to create watermarks but it looks like I use it wrong as the page responded with an error at my test server.
here is my code:
At the link to the main gallery img I embedded the following watermark.php snippet I found to create watermarks:
Is it possible to create watermarks this way or am I completely wrong? Any other option to create a watermark is welcome.
Thank you very much!!!
I found a php script how to create watermarks but it looks like I use it wrong as the page responded with an error at my test server.
here is my code:
- Code: Select all
<cms:pages masterpage="gallery.php" folder=k_folder_name orderby="file_name" limit='30' order='asc' paginate='1'>
<li>
<a href="<cms:embed 'watermark.php'/>" title="<cms:show k_page_title /> <cms:show gg_desc />" data-lightbox="img01-<cms:show k_folder_name />" >
<img src="<cms:show gg_thumb/>" alt="<cms:show k_page_title />" class="img_link "/>
</a>
<i><cms:show k_page_title /></i>
</li>
<span class="gallery"><cms:paginator prev_text='zurück' next_text='weiter'/></span>
</cms:pages>
At the link to the main gallery img I embedded the following watermark.php snippet I found to create watermarks:
- Code: Select all
<cms:php>
$stamp = imagecreatefrompng('../img/watermark.png');
$im = imagecreatefromjpeg('<cms:show gg_image />');
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
</cms:php>
Is it possible to create watermarks this way or am I completely wrong? Any other option to create a watermark is welcome.
Thank you very much!!!