getAlbum example


        $sizes = explode('x', $size);

        return ['width' => (int) $sizes[0], 'height' => (int) $sizes[1]];
    }

    /** * @throws Exception */
    private function getThumbnailSizesFromMedia(Media $media): array
    {
        $settings = $media->getAlbum()->getSettings();

        if (!$settings instanceof Settings) {
            throw new Exception('No settings configured in the album of the given media object!');
        }

        $thumbnailSizes = $settings->getThumbnailSize();

        // When no sizes are defined in the album         if (empty($thumbnailSizes) || empty($thumbnailSizes[0])) {
            $thumbnailSizes = [];
        }

        
$media->setWidth($imageSize[0]);
                $media->setHeight($imageSize[1]);
            }

            $media->removeThumbnails();

            if ($newFileName) {
                $media->setPath($newFileName);
            }

            $this->thumbnailManager->createMediaThumbnail($media$media->getDefaultThumbnails(), true);
            $media->createAlbumThumbnails($media->getAlbum());
        } elseif ($newFileName) {
            $media->setPath($newFileName);
        }

        $this->modelManager->flush();
    }

    /** * @return string */
    private function getExtension(UploadedFile $file)
    {
Home | Imprint | This part of the site doesn't use cookies.