PDA

View Full Version : Watermark in the middle



Petrache Nicolae
July 11, 2012, 09:25 PM
Hello. Does anyone have a clue how to get the watermark in the middle of the images instead of the corner? Thanks

Vladimir
July 12, 2012, 04:06 AM
Hello,

You can to make it so:

1. Open file includes/classes/rlResize.class.php
2. Find the method saveImage()
3. Replace this code (~235):


$dest_x = $this->arrResizedDetails[0] - $watermark_width - $x;
$dest_y = $this->arrResizedDetails[1] - $watermark_height - $y;


to


$dest_x = ($this->arrResizedDetails[0] - $watermark_width) / 2;
$dest_y = ($this->arrResizedDetails[1] - $watermark_height) / 2;


Example:
100

Petrache Nicolae
July 12, 2012, 05:12 AM
my png is still in the right corner. have refreshed several times the cache before adding a new ad. any ideea why is not working?

Vladimir
July 12, 2012, 08:42 AM
I've fixed it in your domain, but it applies only to new uploaded photos. (please check listing id 439, last photo)

Petrache Nicolae
July 12, 2012, 08:51 AM
i have noticed. works fine now. thanks

beside the new modification
$x = 2;
$y = 2;
have you made any other modifications?

forgot to ask something....why the png shows smaller than the actual size? in large file or full size image

Vladimir
July 12, 2012, 11:34 AM
1. No, I've fixed only this code.
2. This is happens because the logo is superimposed on the original photo and then a picture is cropped.

Petrache Nicolae
July 12, 2012, 12:26 PM
ok. thanks for the help

Petrache Nicolae
September 3, 2012, 02:01 PM
1. No, I've fixed only this code.
2. This is happens because the logo is superimposed on the original photo and then a picture is cropped.

hello again. do you have any ideea how to have this working in 4.1 script together with listing label?

if i leave rlResize.class.php untouched, listing label will work but image will be shown on main image very small in and bottom right corner.
if i apply the fix for centered watermark, the watermark will be ok but the listing label will not show at all on main image. will show just for thumbnails. thanks
143144

Tonci Ercegovic
December 26, 2012, 04:38 PM
I asked this also to Flynax. They told me it will be fixed in the next version of the plugin Listing label. I am waiting. I will not use it before they fix that.

Dmitry
December 28, 2012, 12:06 PM
Yes, it will fixed in new version of plugin(large photo).
Position label will be like version because plugin use standard method of software.

Thanks

Tonci Ercegovic
March 9, 2013, 01:07 PM
I see this is really done. Thanks Flynax team!

Petrache Nicolae
October 9, 2013, 10:09 AM
Yes, it will fixed in new version of plugin(large photo).
Position label will be like version because plugin use standard method of software.

Thanks

has this been fixed? i have installed realty/signs theme, activated image watermark, added the link for png image (wich is ok since i can open image via link) and after save, no watermark is added?

olso listing labe (sold) is showing in right bottom side? i belived that in the new version we will have the ability to place it in the middle for instance? what happened?

Petrache Nicolae
December 2, 2013, 11:10 AM
Hello,

You can to make it so:

1. Open file includes/classes/rlResize.class.php
2. Find the method saveImage()
3. Replace this code (~235):


$dest_x = $this->arrResizedDetails[0] - $watermark_width - $x;
$dest_y = $this->arrResizedDetails[1] - $watermark_height - $y;


to


$dest_x = ($this->arrResizedDetails[0] - $watermark_width) / 2;
$dest_y = ($this->arrResizedDetails[1] - $watermark_height) / 2;


Example:
100


Hello. How should this be in the 4.2 version? Thanks

PQB
June 28, 2017, 04:10 AM
how about move to left side corner?

Viktor
June 28, 2017, 04:40 AM
Hello Pascual,

You can set 0 for the variable: $dest_x
$dest_x = 0;
and try to upload photo again.

Aleksandar Apostolovski
January 29, 2019, 11:25 PM
Viktor how should I edit the code so I can put the watermark in the middle of the picture?
My default code is like this:
$dest_x = $this->arrResizedDetails[0] - $watermark_width - $this->driftX;
$dest_y = $this->arrResizedDetails[1] - $watermark_height - $this->driftY;
I'm using auto flynax, heavy wide template.