Created
June 30, 2015 09:37
-
-
Save alpharder/58d6dd96c8d744b8ddf6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/watermarks/func.php b/app/addons/watermarks/func.php | |
index 1793ce5..b11b633 100644 | |
--- a/app/addons/watermarks/func.php | |
+++ b/app/addons/watermarks/func.php | |
@@ -445,7 +445,7 @@ function fn_watermark_create( | |
try { | |
$image = $imagine->open($original_abs_path); | |
- $image->usePalette(new \Imagine\Image\Palette\RGB()); | |
+// $image->usePalette(new \Imagine\Image\Palette\RGB()); | |
$filter = ($imagine instanceof \Imagine\Gd\Imagine) | |
? \Imagine\Image\ImageInterface::FILTER_UNDEFINED | |
@@ -468,7 +468,7 @@ function fn_watermark_create( | |
list(, , , $watermark_image_file_path) = fn_get_image_size($watermark_image_file_path); | |
$watermark_image = $imagine->open($watermark_image_file_path); | |
- $watermark_image->usePalette(new \Imagine\Image\Palette\RGB()); | |
+// $watermark_image->usePalette(new \Imagine\Image\Palette\RGB()); | |
// Watermark image > canvas image | |
$watermark_size = $watermark_image->getSize()->increase(WATERMARK_PADDING); | |
@@ -496,7 +496,7 @@ function fn_watermark_create( | |
} elseif ($settings['type'] == WATERMARK_TYPE_TEXT) { | |
$font_path = Registry::get('config.dir.lib') . 'other/fonts/' . $settings['font'] . '.ttf'; | |
$font_size = $is_detailed ? $settings['font_size_detailed'] : $settings['font_size_icon']; | |
- $font_alpha_blend = 100; | |
+ $font_alpha_blend = null; | |
switch ($settings['font_color']) { | |
case 'white': | |
@@ -515,6 +515,9 @@ function fn_watermark_create( | |
break; | |
} | |
+ if (!$image->palette()->supportsAlpha()) { | |
+ $font_alpha_blend = null; | |
+ } | |
$font = $imagine->font( | |
$font_path, | |
$font_size, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/functions/fn.images.php b/app/functions/fn.images.php | |
index 7b13165..b80ae31 100644 | |
--- a/app/functions/fn.images.php | |
+++ b/app/functions/fn.images.php | |
@@ -616,7 +616,7 @@ function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ff | |
try { | |
$image = $imagine->open($src); | |
- $image->usePalette(new \Imagine\Image\Palette\RGB()); | |
+// $image->usePalette(new \Imagine\Image\Palette\RGB()); | |
$filter = ($imagine instanceof \Imagine\Gd\Imagine) | |
? \Imagine\Image\ImageInterface::FILTER_UNDEFINED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment