We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit f9c88fe0 authored by millette's avatar millette

trac768 keep transparency of resized avatar images.

parent 6eb50606
......@@ -42,9 +42,10 @@ class Avatar extends Memcached_DataObject
$image_s = imagecreatetruecolor($size, $size);
$image_a = $this->to_image();
$square = min($this->width, $this->height);
imagecolortransparent($image_s, imagecolorallocate($image_s, 0, 0, 0));
imagealphablending($image_s, false);
imagesavealpha($image_s, true);
imagecopyresampled($image_s, $image_a, 0, 0, 0, 0,
$size, $size, $square, $square);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment