@@ -104,6 +104,8 @@ public function getImage(string $imagePath, int $width, int $height, array $para
104104 $ retina = $ params ['retina ' ] ?? false ;
105105 /** @var string $title */
106106 $ title = $ params ['title ' ] ?? '' ;
107+ /** @var string $placeholderType */
108+ $ placeholderType = $ params ['placeholder_type ' ] ?? 'default ' ;
107109 /** @var string $alt */
108110 $ alt = $ params ['alt ' ] ?? $ title ;
109111 /** @var string $class */
@@ -114,7 +116,7 @@ public function getImage(string $imagePath, int $width, int $height, array $para
114116 /** @var bool $placeholder */
115117 $ placeholder = (bool )($ params ['placeholder ' ] ?? true );
116118 /** @var string $placeholderImagePath */
117- $ placeholderImagePath = $ this ->placeholderFactory ->create (['type ' => ' image ' ])->getPath ();
119+ $ placeholderImagePath = $ this ->placeholderFactory ->create (['type ' => $ placeholderType ])->getPath ();
118120 /** @var string $placeholderImageUrl */
119121 $ placeholderImageUrl = $ this ->resize ->resizeAndGetUrl ($ placeholderImagePath , $ width , $ height , $ resize );
120122
@@ -123,6 +125,7 @@ public function getImage(string $imagePath, int $width, int $height, array $para
123125 $ mainImageUrl = $ this ->resize ->resizeAndGetUrl ($ imagePath , $ width , $ height , $ resize );
124126 if ($ mainImageUrl === '' ) {
125127 $ imagePath = $ placeholderImagePath ;
128+ $ mainImageUrl = $ placeholderImageUrl ;
126129 }
127130
128131 if ($ this ->isSvgImage ($ imagePath )) {
0 commit comments