/** * {@inheritdoc} */ public function generatePrivateUrl(MediaProviderInterface $provider, MediaInterface $media, $format) { if ('reference' === $format) { return $provider->getReferenceImage($media); } return sprintf('%s/thumb_%s_%s.%s', $provider->generatePath($media), $media->getId(), $format, $this->getExtension($media)); }
/** * {@inheritdoc} */ public function generatePrivateUrl(MediaProviderInterface $provider, MediaInterface $media, $format) { if ($format != 'reference') { throw new \RuntimeException('No private url for LiipImagineThumbnail'); } $path = $provider->getReferenceImage($media); return $path; }
/** * {@inheritdoc} */ public function generatePublicUrl(MediaProviderInterface $provider, MediaInterface $media, $format) { if ($format == 'reference') { $path = $provider->getReferenceImage($media); } else { $path = sprintf('%s/thumb_%s_%s.%s', $provider->generatePath($media), $media->getId(), $format, $this->getExtension($media)); } return $path; }