| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: watermark.module,v 1.5.2.5 2007/07/07 17:53:29 kbahey Exp $ |
// $Id: watermark.module,v 1.5.2.6 2008/05/17 20:38:05 kbahey Exp $ |
| 4 |
// Author: Khalid Baheyeldin of http://2bits.com |
// Author: Khalid Baheyeldin of http://2bits.com |
| 5 |
// Additional features by schnizZzla for http://BerlinerStrassen.com |
// Additional features by schnizZzla for http://BerlinerStrassen.com |
| 6 |
|
|
| 407 |
watchdog(WATERMARK_WATCHDOG, $msg, WATCHDOG_ERROR); |
watchdog(WATERMARK_WATCHDOG, $msg, WATCHDOG_ERROR); |
| 408 |
} |
} |
| 409 |
// create an image of the same type! |
// create an image of the same type! |
| 410 |
else if (!$img_create_func($im, $image_path)) { |
else if (!_watermark_create_image($im, $image_path, $img_create_func)) { |
| 411 |
$msg = t('Failed to save merged image.'); |
$msg = t('Failed to save merged image.'); |
| 412 |
drupal_set_message($msg, 'error'); |
drupal_set_message($msg, 'error'); |
| 413 |
watchdog(WATERMARK_WATCHDOG, $msg, WATCHDOG_ERROR); |
watchdog(WATERMARK_WATCHDOG, $msg, WATCHDOG_ERROR); |
| 422 |
return $status; |
return $status; |
| 423 |
} |
} |
| 424 |
|
|
| 425 |
|
function _watermark_create_image($im, $image_path, $img_create_func) { |
| 426 |
|
if ($img_create_func == 'imagejpeg') |
| 427 |
|
return $img_create_func($im, $image_path, variable_get('image_jpeg_quality', 80)); |
| 428 |
|
else |
| 429 |
|
return $img_create_fucn($im, $image_path); |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
|
| 433 |
function _watermark_make_image($file) { |
function _watermark_make_image($file) { |
| 434 |
|
|
| 435 |
if (!file_exists($file)) { |
if (!file_exists($file)) { |