Skip to content

Commit 2106fd7

Browse files
committed
fix: correct output of multiple art directed sources
1 parent d3af3a2 commit 2106fd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

classes/Imagex.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,15 @@ private function getArtDirectedSourcesPerFormat(string $format): array
308308
{
309309
$sources = [];
310310

311-
foreach($this->sourcesArtDirected as $source) {
311+
foreach ($this->sourcesArtDirected as $source) {
312312
$sourceRatio = $source['ratio'] ?? 'intrinsic';
313313
$sourceImage = $source['image'] ?? null;
314314

315315
$srcsetPreset = $this->getDynamicSrcsetPreset($sourceRatio, $sourceImage);
316316
$srcsetValue = $this->getSrcsetValue($srcsetPreset[$format], $sourceImage);
317317
$sourceAttributes = $this->getSourceAttributes($format, $srcsetValue, $srcsetPreset, $source);
318318

319-
$sources = array_merge($sources, $sourceAttributes);
319+
$sources[] = $sourceAttributes;
320320
}
321321

322322
return $sources;
@@ -361,7 +361,7 @@ public function getPictureSources(): array
361361
}
362362

363363
if (!empty($this->sourcesArtDirected)) {
364-
$sources[] = $this->getArtDirectedSourcesPerFormat($format);
364+
$sources = array_merge($sources, $this->getArtDirectedSourcesPerFormat($format));
365365
}
366366

367367
$sources[] = $this->getDefaultSourcesPerFormat($format);

0 commit comments

Comments
 (0)