Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
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:
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!!!
Hi Christoph,

Please check out viewtopic.php?f=8&t=8012

Hope it helps. Do let me know.
This works great!!!

I used it like below with the lightbox and everything works perfect.

Code: Select all
<li>
<a href="<cms:watermark "<cms:show gg_image />" />" 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>         
</li>


I did not expect to get an whole addon :)
Thank you very much Kamran. I guess this is really useful for a lot of us.
You are welcome, Christoph :)
I am glad you found it useful.
Hello:

How would I center the watermark along the bottom?


Thank you.
rspohn wrote: Hello:

How would I center the watermark along the bottom?


Thank you.


Hello rspohn,

Code: Select all
<cms:watermark my_image with='my_watermark.png' at='bottom_center' />


You are welcome.
6 posts Page 1 of 1
cron