setThumbnailQuality example

static::assertInstanceOf(MediaFolderConfigurationEntity::class$media->getMediaFolder()->getConfiguration());

        $media->getMediaFolder()->getConfiguration()->setMediaThumbnailSizes(
            new MediaThumbnailSizeCollection([
                (new MediaThumbnailSizeEntity())->assign([
                    'id' => Uuid::randomHex(),
                    'width' => 1530,
                    'height' => 1530,
                ]),
            ])
        );
        $media->getMediaFolder()->getConfiguration()->setThumbnailQuality(100);

        $filePath = $this->urlGenerator->getRelativeMediaUrl($media);
        $resource = fopen(__DIR__ . '/../fixtures/shopware_optimized.jpg', 'rb');
        \assert($resource !== false);
        $this->getPublicFilesystem()->writeStream($filePath$resource);

        $this->thumbnailService->updateThumbnails(
            $media,
            $this->context,
            false
        );

        
$thumbnailSizes = $parentSettings->getThumbnailSize();
            $thumbnailHighDpi = $parentSettings->isThumbnailHighDpi();
            $thumbnailHighDpiQuality = $parentSettings->getThumbnailHighDpiQuality();
            $thumbnailQuality = $parentSettings->getThumbnailQuality();
            $createThumbnails = $parentSettings->getCreateThumbnails();
        }

        $settings->setCreateThumbnails($createThumbnails);
        $settings->setThumbnailSize(empty($thumbnailSizes) ? '' : $thumbnailSizes);
        $settings->setThumbnailHighDpi($thumbnailHighDpi);
        $settings->setThumbnailQuality($thumbnailQuality);
        $settings->setThumbnailHighDpiQuality($thumbnailHighDpiQuality);
        $settings->setIcon($icon);

        $data['settings'] = $settings;

        return $data;
    }

    /** * Helper method to prefix properties * * @param string $prefix * * @return array */
Home | Imprint | This part of the site doesn't use cookies.