diff options
author | modus75 <modus75@users.noreply.github.com> | 2015-10-15 22:05:20 +0200 |
---|---|---|
committer | modus75 <modus75@users.noreply.github.com> | 2015-10-15 22:05:20 +0200 |
commit | d7fef70c4c3707fd7650896c5a62f0a7c5cc81f0 (patch) | |
tree | 539c0807d513c250242f13e5eebc3e89031b3519 /i.php | |
parent | 11ccdff58523d10ccc970b879c5de01e7ec40ee2 (diff) |
fix #361 - Watermark Y repeat
Diffstat (limited to '')
-rw-r--r-- | i.php | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -575,17 +575,23 @@ if ($params->will_watermark($d_size)) if ($image->compose($wm_image, $x, $y, $wm->opacity)) { $changes++; - if ($wm->xrepeat) + if ($wm->xrepeat || $wm->yrepeat) { - // todo - $pad = $wm_size[0] + max(30, round($wm_size[0]/4)); + $xpad = $wm_size[0] + max(30, round($wm_size[0]/4)); + $ypad = $wm_size[1] + max(30, round($wm_size[1]/4)); + for($i=-$wm->xrepeat; $i<=$wm->xrepeat; $i++) { - if (!$i) continue; - $x2 = $x + $i * $pad; - if ($x2>=0 && $x2+$wm_size[0]<$d_size[0]) - if (!$image->compose($wm_image, $x2, $y, $wm->opacity)) - break; + for($j=-$wm->yrepeat; $j<=$wm->yrepeat; $j++) + { + if (!$i && !$j) continue; + $x2 = $x + $i * $xpad; + $y2 = $y + $j * $ypad; + if ($x2>=0 && $x2+$wm_size[0]<$d_size[0] && + $y2>=0 && $y2+$wm_size[1]<$d_size[1] ) + if (!$image->compose($wm_image, $x2, $y2, $wm->opacity)) + break; + } } } } |