/** * Render thumbnail from object storage * * @access private * @param string $filename * @param integer $size */ private function render($filename, $size) { try { $blob = $this->objectStorage->get($filename); Thumbnail::createFromString($blob)->resize($size, $size)->toOutput(); } catch (ObjectStorageException $e) { $this->logger->error($e->getMessage()); } }
/** * Generate thumbnail from a local file * * @access public * @param string $uploaded_filename * @param string $destination_filename */ public function generateThumbnailFromFile($uploaded_filename, $destination_filename) { $blob = Thumbnail::createFromFile($uploaded_filename)->resize()->toString(); $this->objectStorage->put($this->getThumbnailPath($destination_filename), $blob); }