/** * @param Image $image * @param int $format */ public function __construct(Image $image, $format) { parent::__construct($image->get($format), 200, ['Content-type' => 'image/' . $format]); }
/** * Returns the image resource in the given format. */ public function get($format = 'png') { $this->create(); return $this->image->get($format); }