Changeset 531

Show
Ignore:
Timestamp:
08/02/07 15:02:23 (1 year ago)
Author:
louisedade
Message:

avatar-upload: committing version 0.8 - added support for transparent GIFs and PNGs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • avatar-upload/trunk/additional-files/avatar-upload.php

    r510 r531  
    215215                        $im1 = @imagecreatefromgif($img_temp); 
    216216                        $im2 = @imagecreate($new_width, $new_height) or $error = 1; 
     217                        $bg = @imagecolorallocate($im2, 192, 192, 192); // default background color 
     218                        @imagecolortransparent($im2, $bg); // make it transparent 
    217219                        @imagecopyresampled ($im2, $im1, 0, 0, 0, 0, $new_width, $new_height, $img_w, $img_h); 
    218220                        @imagegif($im2, $img_temp); 
     
    232234                        $im1 = @imagecreatefrompng($img_temp); 
    233235                        $im2 = ($truecolor) ? @imagecreatetruecolor($new_width, $new_height) : @imagecreate($new_width, $new_height); 
     236                        $bg = @imagecolorallocate($im2, 192, 192, 192); // default background colour 
     237                        @imagecolortransparent($im2, $bg); // make it transparent 
     238                        @imagealphablending($im2, false); // stop alpha blending 
     239                        @imagesavealpha($im2, true); // save original image alpha channel 
    234240                        @imagecopyresampled ($im2, $im1, 0, 0, 0, 0, $new_width, $new_height, $img_w, $img_h); 
    235241                        $im2 = ($truecolor) ? do_unsharp_mask($im2, $config->use_unsharpmask) : $im2; 
  • avatar-upload/trunk/bb-avatar-upload.php

    r510 r531  
    33Plugin Name: Avatar Upload 
    44Plugin URI: http://bbpress.org/plugins/topic/46 
    5 Version: 0.7 
     5Version: 0.8 
    66Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress. 
    77Author: Louise Dade 
  • avatar-upload/trunk/readme.txt

    r510 r531  
    44Requires at least: 0.8.2 
    55Tested up to: 0.8.2.1 
    6 Stable Tag: 0.7 
     6Stable Tag: 0.8 
    77 
    88Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress. Admins can configure maximum allowed file size and image dimensions. Includes fel64's code enabling 'Identicons' - default avatars made of abstract patterns unique to each user. 
     
    133133 
    134134== Change Log == 
     1352007-08-02 Ver. 0.8   Added support for transparent GIFs and PNGs in resize routine. 
    135136 
    1361372007-07-23 Ver. 0.7   Added admin page for configuration, added an unsharp mask function, changed