// Initial the data array
$imageData =
[];
$mediaService =
Shopware()->
Container()->
get(MediaServiceInterface::
class);
if (empty($image['path'
])) { return $imageData;
} // First we get all thumbnail sizes of the product album
$sizes =
$productAlbum->
getSettings()->
getThumbnailSize();
$highDpiThumbnails =
$productAlbum->
getSettings()->
isThumbnailHighDpi();
// If no extension is configured, shopware use jpg as default extension
if (empty($image['extension'
])) { $image['extension'
] = 'jpg';
} $imageData['src'
]['original'
] =
$mediaService->
getUrl($image['media'
]['path'
]);
$imageData['res'
]['original'
]['width'
] =
$image['width'
];
$imageData['res'
]['original'
]['height'
] =
$image['height'
];
$imageData['res'
]['description'
] =
$image['description'
];
$imageData['position'
] =
$image['position'
];