- imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
-
- if($this->type == IMAGETYPE_BMP) {
- //we don't want to save BMP... it's an inefficient, rare, antiquated format
- //save png instead
- $this->type = IMAGETYPE_PNG;
- } else if($this->type == IMAGETYPE_WBMP) {
- //we don't want to save WBMP... it's a rare format that we can't guarantee clients will support
- //save png instead
- $this->type = IMAGETYPE_PNG;
- } else if($this->type == IMAGETYPE_XBM) {
- //we don't want to save XBM... it's a rare format that we can't guarantee clients will support
- //save png instead
- $this->type = IMAGETYPE_PNG;
- } else if($this->type == IMAGETYPE_XPM) {
- //we don't want to save XPM... it's a rare format that we can't guarantee clients will support
- //save png instead
- $this->type = IMAGETYPE_PNG;
- }
-
- $outname = Avatar::filename($this->id,
- image_type_to_extension($this->type),
- $size,
- common_timestamp());
-
- $outpath = Avatar::path($outname);
+ imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $width, $height, $w, $h);