size.$this->ext"; } public function get() { $image = $this->avatar->get($this->size); $res = $image->resource(); ob_start(); if ($this->ext === 'png') { imagepng($res); } else { imagejpeg($res); } return ob_get_clean(); } /** * Returns the mime-type for a file * * If null is returned, we'll assume application/octet-stream * * @return string|null */ public function getContentType() { if ($this->ext === 'png') { return 'image/png'; } return 'image/jpeg'; } public function getETag() { return $this->avatar->getFile($this->size)->getEtag(); } public function getLastModified() { return $this->avatar->getFile($this->size)->getMTime(); } }