Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getAlbumSettingsFromMedia example
$imagePath
=
$media
->
getPath
(
)
;
if
(
$media
->
getType
(
)
!==
$media
::TYPE_IMAGE
)
{
throw
new
Exception
(
sprintf
(
'File %s is not an image.',
$imagePath
)
)
;
}
if
(
empty
(
$thumbnailSizes
)
)
{
$thumbnailSizes
=
$this
->
getThumbnailSizesFromMedia
(
$media
)
;
$thumbnailSizes
=
array_merge
(
$thumbnailSizes
,
$media
->
getDefaultThumbnails
(
)
)
;
}
$albumSettings
=
$this
->
getAlbumSettingsFromMedia
(
$media
)
;
if
(
$albumSettings
)
{
$highDpi
=
$albumSettings
->
isThumbnailHighDpi
(
)
;
$standardQuality
=
$albumSettings
->
getThumbnailQuality
(
)
;
$highDpiQuality
=
$albumSettings
->
getThumbnailHighDpiQuality
(
)
;
}
else
{
$highDpi
= false;
$standardQuality
= 90;
$highDpiQuality
= 90;
}
if
(
$standardQuality
=== null
)
{