@@ -28,16 +28,17 @@ public static function generate(): void
2828 $ svg = $ set ->value ('svg ' );
2929 $ background = $ set ->value ('background ' );
3030
31- self ::createThumbnail ($ svg , $ site ->handle () . '/icon-180.png ' , 180 , 180 , $ background , 15 );
32- self ::createThumbnail ($ svg , $ site ->handle () . '/icon-512.png ' , 512 , 512 , $ background , 15 );
33- self ::createThumbnail ($ svg , $ site ->handle () . '/favicon-16x16.png ' , 16 , 16 , 'transparent ' , false );
34- self ::createThumbnail ($ svg , $ site ->handle () . '/favicon-32x32.png ' , 32 , 32 , 'transparent ' , false );
31+ self ::createThumbnail ($ svg , $ site ->handle () . '/icon-180.png ' , 'png32 ' , 180 , 180 , $ background , 15 );
32+ self ::createThumbnail ($ svg , $ site ->handle () . '/icon-512.png ' , 'png32 ' , 512 , 512 , $ background , 15 );
33+ self ::createThumbnail ($ svg , $ site ->handle () . '/favicon-16x16.png ' , 'png32 ' , 16 , 16 , 'transparent ' , false );
34+ self ::createThumbnail ($ svg , $ site ->handle () . '/favicon-32x32.png ' , 'png32 ' , 32 , 32 , 'transparent ' , false );
35+ self ::createThumbnail ($ svg , $ site ->handle () . '/favicon.ico ' , 'ico ' , 32 , 32 , 'transparent ' , false );
3536 });
3637
3738 Artisan::call ('cache:clear ' );
3839 }
3940
40- protected static function createThumbnail ($ import , $ export , $ width , $ height , $ background , $ border ): void
41+ protected static function createThumbnail ($ import , $ export , $ format , $ width , $ height , $ background , $ border ): void
4142 {
4243 $ svg = Storage::disk ('favicons ' )->get ($ import );
4344 $ svgObj = simplexml_load_string ($ svg );
@@ -71,7 +72,7 @@ protected static function createThumbnail($import, $export, $width, $height, $ba
7172 $ img ->resizeImage ($ width , $ height , \Imagick::FILTER_LANCZOS , 1 );
7273 }
7374
74- $ img ->setImageFormat (' png32 ' );
75+ $ img ->setImageFormat ($ format );
7576 Storage::disk ('favicons ' )->put ($ export , $ img ->getImageBlob ());
7677 $ img ->clear ();
7778 $ img ->destroy ();
0 commit comments