Fix transparency for transparent PNGs when resizing - refs BT#7293

1.9.x
Yannick Warnier 11 years ago
parent f7a25debf5
commit 71e0e9c9d2
  1. 7
      main/inc/lib/image.lib.php
  2. 2
      main/newscorm/learnpath.class.php

@ -220,7 +220,8 @@ class GDWrapper extends ImageWrapper {
if ($handler) {
$this->image_validated = true;
$this->bg = $handler;
@imagealphablending($this->bg, true);
@imagealphablending($this->bg, false);
@imagesavealpha($this->bg, true);
}
}
@ -259,6 +260,8 @@ class GDWrapper extends ImageWrapper {
$deltaw = (int)(($thumbw - $width) / 2);
$deltah = (int)(($thumbh - $height) / 2);
$dst_img = @ImageCreateTrueColor($thumbw, $thumbh);
@imagealphablending($dst_img, false);
@imagesavealpha($dst_img, true);
if (!empty($this->color)) {
@imagefill($dst_img, 0, 0, $this->color);
}
@ -276,6 +279,8 @@ class GDWrapper extends ImageWrapper {
$deltaw = 0;
$deltah = 0;
$dst_img = @ImageCreateTrueColor($width, $height);
@imagealphablending($dst_img, false);
@imagesavealpha($dst_img, true);
$this->width = $width;
$this->height = $height;
}

@ -9066,7 +9066,7 @@ EOD;
$image_moved = true;
$this->set_preview_image($new_file_name);
//Resize to 32
//Resize to 64px to use on course homepage
$temp->resize(64, 64, 0);
$temp->send_image($updir.'/'.$filename.'.64.'.$file_extension);
return true;

Loading…
Cancel
Save