/**
  * Generate a thumbnail for $media
  *
  * @param MediaInterface $media
  */
 public function generateThumbnail(MediaInterface $media)
 {
     $fileName = $media->getFilesystemName();
     $thumbnailName = '';
     $extractedImagePath = $this->imageManager->extractImageFromPdf($this->tmpDir . DIRECTORY_SEPARATOR . $fileName);
     $thumbnailPath = $this->imageManager->generateAlternative($extractedImagePath, $this->thumbnailFormat);
     if ($thumbnailPath != '') {
         $thumbnailName = self::THUMBNAIL_PREFIX . '-' . str_replace('.pdf', '.jpg', $fileName);
         $this->mediaStorageManager->uploadFile($thumbnailName, $thumbnailPath);
     }
     if (trim($extractedImagePath, DIRECTORY_SEPARATOR) != trim($this->tmpDir, DIRECTORY_SEPARATOR)) {
         $this->fileSystem->remove(array($extractedImagePath));
     }
     $media->setThumbnail($thumbnailName);
 }
 /**
  * Generate a thumbnail for $media
  *
  * @param MediaInterface $media
  */
 public function generateThumbnail(MediaInterface $media)
 {
     $fileName = $media->getFilesystemName();
     $thumbnailName = '';
     $extractedImagePath = $this->videoManager->extractImageFromVideo($this->tmpDir . DIRECTORY_SEPARATOR . $fileName, 1);
     $thumbnailPath = $this->imageManager->generateAlternative($extractedImagePath, $this->thumbnailFormat);
     if ('' !== $thumbnailPath) {
         $thumbnailName = self::THUMBNAIL_PREFIX . '-' . pathinfo($fileName, PATHINFO_FILENAME) . '.jpg';
         $this->mediaStorageManager->uploadFile($thumbnailName, $thumbnailPath);
     }
     if (trim($extractedImagePath, DIRECTORY_SEPARATOR) !== trim($this->tmpDir, DIRECTORY_SEPARATOR)) {
         $this->fileSystem->remove(array($extractedImagePath));
     }
     $media->setThumbnail($thumbnailName);
 }
 /**
  * Generate a thumbnail for $media
  *
  * @param MediaInterface $media
  */
 public function generateThumbnail(MediaInterface $media)
 {
     $thumbnailName = $this->generateAlternative($media->getFilesystemName(), self::THUMBNAIL_PREFIX, $this->thumbnailFormat);
     $media->setThumbnail($thumbnailName);
 }
 /**
  * @param MediaInterface $media
  */
 public function generateThumbnail(MediaInterface $media)
 {
     $media->setThumbnail($this->thumbnail);
 }