summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Image_lib.php7
-rw-r--r--user_guide/changelog.html1
2 files changed, 8 insertions, 0 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 21e0a709b..806d942ba 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -513,6 +513,13 @@ class CI_Image_lib {
}
$dst_img = $create($this->width, $this->height);
+
+ if ($this->image_type == 3) // png we can actually preserve transparency
+ {
+ imagealphablending($dst_img, FALSE);
+ imagesavealpha($dst_img, TRUE);
+ }
+
$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);
// Show the image
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 171392f46..48d4309a5 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -98,6 +98,7 @@ Hg Tag: </p>
<li>Changed <kbd>do_xss_clean()</kbd> to return FALSE if the uploaded file fails XSS checks.</li>
<li>Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.</li>
<li>Added a second parameter (boolean) to <kbd>$this->zip->read_dir('/path/to/directory', FALSE)</kbd> to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.</li>
+ <li>Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.</p>
</ul>
</li>
<li>Database