Hello
I want to add to my images watermark when picture is enlarged how can I do this?
can help somebody?
I want to add to my images watermark when picture is enlarged how can I do this?
can help somebody?
1. either DIV Overlay
2. or advance bring it manually on the images
2. or advance bring it manually on the images
Alles für die Anwendung im deutschen Sprachraum
Hier gehts zum deutschen Forumbereich
But I need watermark only in picture enlarged..in popup...is it possible to create watermark by php function..and how? thanks
i 've added this line of code
$image->watermark('watermark.png', 'bottomright');
to image.php in system / helper
but it doesn't work...
$image->watermark('watermark.png', 'bottomright');
to image.php in system / helper
but it doesn't work...
yes watermark image is in the image folder and I try also add exact location of watermark image
this is error statement that i've got...images are in jpg format
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /domains1/do1231500/public/www_root/vmshop/system/library/image.php on line 34
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/domains1/do1231500/public/www_root/vmshop/image/watermark.png' is not a valid JPEG file in /system/library/image.php on line 34
Warning: imagesx(): supplied argument is not a valid Image resource in /system/library/image.php on line 88
Warning: imagesy(): supplied argument is not a valid Image resource in /system/library/image.php on line 89
Warning: imagecopy(): supplied argument is not a valid Image resource in /system/library/image.php on line 110
Warning: imagedestroy(): supplied argument is not a valid Image resource in /system/library/image.php on line 112
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /domains1/do1231500/public/www_root/vmshop/system/library/image.php on line 34
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/domains1/do1231500/public/www_root/vmshop/image/watermark.png' is not a valid JPEG file in /system/library/image.php on line 34
Warning: imagesx(): supplied argument is not a valid Image resource in /system/library/image.php on line 88
Warning: imagesy(): supplied argument is not a valid Image resource in /system/library/image.php on line 89
Warning: imagecopy(): supplied argument is not a valid Image resource in /system/library/image.php on line 110
Warning: imagedestroy(): supplied argument is not a valid Image resource in /system/library/image.php on line 112
Hello,
You must modify the watermark method ...
In your helper you can use this solution like this :
Nico
You must modify the watermark method ...
Code: Select all
public function watermark($file, $position = 'bottomright') {
//Pb ! you don't work on the true object => you must modify the "create" method ($mime = $this->info['mime']; it's work only if we have the same image format !
//$watermark = $this->create($file);
//Prefer PNG files => it's not optimized but it's work
$watermark = imagecreatefrompng($file);
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
switch($position) {
case 'topleft':
$watermark_pos_x = 0;
$watermark_pos_y = 0;
break;
case 'topright':
$watermark_pos_x = $this->info['width'] - $watermark_width;
$watermark_pos_y = 0;
break;
case 'bottomleft':
$watermark_pos_x = 0;
$watermark_pos_y = $this->info['height'] - $watermark_height;
break;
case 'bottomright':
$watermark_pos_x = $this->info['width'] - $watermark_width;
$watermark_pos_y = $this->info['height'] - $watermark_height;
break;
}
imagecopy($this->image, $watermark, $watermark_pos_x, $watermark_pos_y, 0, 0, $watermark_width, $watermark_height);
imagedestroy($watermark);
}
Code: Select all
$image = new Image(DIR_IMAGE . $old_image);
$image->resize($width, $height);
$image->watermark(HTTP_IMAGE . 'watermark.png', 'bottomright');
$image->save(DIR_IMAGE . $new_image);
Hi.
I have this working, however I was wondering if it is possible to make the watermark match the size of the image it is being put over the top of? Essentially
LARGE WATERMARK
placed over
LARGE IMAGE
then
RESIZED to the size needed
anyone that can help? I have the watermark part working fine its just the image is being resized smaller while the watermark remains full size over the top and covers half the image
Thanks!
I have this working, however I was wondering if it is possible to make the watermark match the size of the image it is being put over the top of? Essentially
LARGE WATERMARK
placed over
LARGE IMAGE
then
RESIZED to the size needed
anyone that can help? I have the watermark part working fine its just the image is being resized smaller while the watermark remains full size over the top and covers half the image
Thanks!
HA! I sorted both problems in 10 seconds!
For those that want to know
I changed the order from
$image = new Image(DIR_IMAGE . $old_image);
$image->resize($width, $height);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
to
$image = new Image(DIR_IMAGE . $old_image);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
$image->resize($width, $height);
simples
For those that want to know
I changed the order from
$image = new Image(DIR_IMAGE . $old_image);
$image->resize($width, $height);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
to
$image = new Image(DIR_IMAGE . $old_image);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
$image->resize($width, $height);
simples
Ive just tested this out and it works but the watermark is very small. How does one make it bigger?
Cheers
Cheers
OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods
I would think the first thing to "center" my watermark would be to remove "bottomright" from the parameter and replace it with something like "center"itrends wrote:HA! I sorted both problems in 10 seconds!
For those that want to know
I changed the order from
$image = new Image(DIR_IMAGE . $old_image);
$image->resize($width, $height);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
to
$image = new Image(DIR_IMAGE . $old_image);
$image->watermark(HTTP_IMAGE . 'overlay.png', 'bottomright');
$image->resize($width, $height);
simples
Who is online
Users browsing this forum: No registered users and 14 guests