21491 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 737 Views |
-
watermark over an image?

27 February 2011 at 8:04pm
Hello,
I have following FittedImage.php:
<?php
class FittedImage extends Image {function generateMainImage($gd) {
$gd->setQuality(85);
return $gd->resizeRatio(600,600);
}function generateThumbImage($gd) {
$gd->setQuality(85);
return $gd->resizeRatio(150,150);
}}
?>Then I have new dataobject, called product, where:
...
static $has_one = array (
'ProductImage' => 'FittedImage'
);
...And in template I am using
...
<a href="$ProductImage.MainImage.URL" class="fancybox"><img src="$ProductImage.ThumbImage.URL" alt="$ProductName" /></a>
...What I would like to do, is to place small watermark (images/thumb-watermark.png) over thumb image and larger watermark (images/main-watermark.png) over main image.
How do I do that? I found this topic: http://silverstripe.org/archive/show/275 but I have no idea what to do with the code. What do I put in the FittedImage.php and where do I put it, and what do I use in the template?
Thanks a lot!
| 737 Views | ||
|
Page:
1
|
Go to Top |

