It would be great the option to watermark the images uploaded by imagefield.
I've done a fast attemp and now it's working fine for me. It is just insert a few lines after the resizing action:
[line 325, just before the "return $file;", add this]
if ( $width > 400 ) {
$watermark = imagecreatefrompng('./watermark.png');
} else {
$watermark = imagecreatefrompng('./watermarklow.png');
}
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$imagen = imagecreatefromjpeg($file['filepath']);
$size = getimagesize($file['filepath']);
$dest_x = $size[0] - $watermark_width - 5;
$dest_y = $size[1] - $watermark_height - 5;
imagecopymerge($imagen, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 50);
imagejpeg($imagen,$file['filepath']);
imagedestroy($imagen);
[...]
As you can see I've inserted a previos "if" because I wanted to have two different watermarks, depending on the size of the image...
As I said before, this is a fast solution, but it would be nice to have it better developed in the imagefield.module.
Comments
Comment #1
quicksketchThis is already a feature slated for imagecache. But since there isn't an active issue for this request, this is it! :D
If you haven't yet combined imagecache with imagefield, you should try it out to see all the neat options it give you in the latest CCK and Views versions.
Moving to imagecache project.
Comment #2
jpetso commentedMarking this as duplicate of #184816, because that one is more active and contains more recent patches.