Return the url to an specific format of an media.
/** * {@inheritdoc} */ public function getFormats($id, $fileName, $storageOptions, $version, $subVersion, $mimeType) { $formats = []; if ($this->checkMimeTypeSupported($mimeType)) { foreach ($this->formats as $format) { $formats[$format['key']] = $this->formatCache->getMediaUrl($id, $this->replaceExtension($fileName, $mimeType), $storageOptions, $format['key'], $version, $subVersion); } } return $formats; }
/** * {@inheritdoc} */ public function getFormats($id, $fileName, $storageOptions, $version, $mimeType) { $formats = []; if (in_array($mimeType, $this->previewMimeTypes)) { foreach ($this->formats as $format) { $formats[$format['name']] = $this->formatCache->getMediaUrl($id, $this->replaceExtension($fileName, $this->getImageExtension($fileName)), $storageOptions, $format['name'], $version); } } return $formats; }