public function rotate($deg) { // Create a new image resource and rotate it. $color = $this->setColor($this->backgroundColor); $this->resource->rotateImage($color, $deg); $this->setImageInfo(); return $this; }