| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: watermark.inc,v 1.1.4.5 2009/08/31 04:12:20 dman Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file routine for image layering |
* @file routine for image layering |
| 5 |
* |
* |
| 90 |
$return_color = $this->_get_image_color($return_img, $avg_red, $avg_green, $avg_blue, $new_alpha); |
$return_color = $this->_get_image_color($return_img, $avg_red, $avg_green, $avg_blue, $new_alpha); |
| 91 |
} |
} |
| 92 |
else { |
else { |
| 93 |
/* |
// Point is out of bounds from the watermark. Return the normal image color |
| 94 |
|
|
| 95 |
// allow watermark to overflow from the image. Rare, but could be useful |
// allow watermark to overflow from the image. Rare, but could be useful |
| 96 |
if ($x > imagesx($main_img_obj) || $y > imagesy($main_img_obj)) { |
if ($x > imagesx($main_img_obj) || $y > imagesy($main_img_obj)) { |
| 97 |
|
// Point is out of bounds from the main image too. Return transparent |
| 98 |
$watermark_rbg = imagecolorsforindex($watermark_img_obj, imagecolorat($watermark_img_obj, $watermark_x, $watermark_y)); |
$watermark_rbg = imagecolorsforindex($watermark_img_obj, imagecolorat($watermark_img_obj, $watermark_x, $watermark_y)); |
| 99 |
$watermark_alpha = 0;#round(((127 - $watermark_rbg['alpha']) / 127), 2); |
$watermark_alpha = 0;#round(((127 - $watermark_rbg['alpha']) / 127), 2); |
| 100 |
$return_color = $this->_get_image_color($return_img, $watermark_rbg['red'], $watermark_rbg['green'], $watermark_rbg['blue'], $watermark_alpha); |
$return_color = $this->_get_image_color($return_img, $watermark_rbg['red'], $watermark_rbg['green'], $watermark_rbg['blue'], $watermark_alpha); |
| 101 |
} |
} |
| 102 |
else { |
else { |
|
*/ |
|
| 103 |
$return_color = imagecolorat($main_img_obj, $x, $y); |
$return_color = imagecolorat($main_img_obj, $x, $y); |
|
/* |
|
| 104 |
} |
} |
| 105 |
*/ |
|
| 106 |
} |
} |
| 107 |
if ($return_color == $transparent_ix) { |
if ($return_color == $transparent_ix) { |
| 108 |
$return_color = $transparent; |
$return_color = $transparent; |