protected function copyImage($w, $h, $x = 0, $y = 0) { imagecopyresampled($this->output, $this->resource, 0, 0, $x, $y, $w, $h, $this->width, $this->height); $this->width = imagesx($this->output); $this->height = imagesy($this->output); }