]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
trac768 keep transparency of resized avatar images.
authormillette <millette@controlyourself.ca>
Thu, 4 Dec 2008 18:29:53 +0000 (13:29 -0500)
committermillette <millette@controlyourself.ca>
Thu, 4 Dec 2008 18:29:53 +0000 (13:29 -0500)
darcs-hash:20081204182953-099f7-b47315607d937da4d648b200a733c715a97d9bc2.gz

classes/Avatar.php

index 05a5ee8ef318f3fb7d0b8d30387d274c0c3e6bb2..901c47c51e8e4c039f15daaeaefe1dcad7d27397 100644 (file)
@@ -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);