public function inSquare($widthHeight, $borders=0) { $newImage = imagecreatetruecolor($widthHeight, $widthHeight); $white = imagecolorallocate($newImage, 255, 255, 255); imagefill($newImage, 0, 0, $white); imagecolortransparent($newImage, $white); $this->resize($widthHeight-($borders*2), $widthHeight-($borders*2)); if($this->width > $this->height) { $left = $borders; $top = round(($widthHeight-$this->height)/2);} else {$left = round(($widthHeight-$this->width)/2); $top = $borders;} imagecopy($newImage, $this->image, $left, $top, 0, 0, $this->width, $this->height); $this->width = $widthHeight; $this->height = $widthHeight; $this->image = $newImage; return $this; } This feature leaves a black bar to the right of the original image. Why? 