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

Conflicts:
	main/inc/lib/image.lib.php
1.10.x
Yannick Warnier 11 years ago
parent 42255f9f8e
commit 06d1c3a1a9
  1. 9
      main/inc/lib/image.lib.php
  2. 2
      main/newscorm/learnpath.class.php

@ -221,8 +221,9 @@ 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);
}
}
public function get_image_size() {
@ -260,6 +261,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);
}
@ -277,6 +280,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;
}

@ -10351,7 +10351,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);

Loading…
Cancel
Save