@@ -150,6 +150,8 @@ class Options
150
150
// Thumbnail Images Options
151
151
private bool $ writeThumbnail = false ;
152
152
private bool $ writeAllThumbnails = false ;
153
+ private ?string $ convertThumbnail = null ;
154
+
153
155
154
156
// Verbosity / Simulation Options
155
157
private bool $ skipDownload = false ;
@@ -1023,6 +1025,18 @@ public function writeThumbnail(bool $writeThumbnail): self
1023
1025
return $ new ;
1024
1026
}
1025
1027
1028
+ /**
1029
+ * Convert thumbnail to another format.
1030
+ * @param 'jpg'|'png'|'webp'|null $format
1031
+ */
1032
+ public function convertThumbnail (?string $ format ): self
1033
+ {
1034
+ $ new = clone $ this ;
1035
+ $ new ->convertThumbnail = $ format ;
1036
+
1037
+ return $ new ;
1038
+ }
1039
+
1026
1040
/**
1027
1041
* Write all thumbnail image formats to disk.
1028
1042
*/
@@ -1837,6 +1851,8 @@ public function toArray(): array
1837
1851
// Thumbnail Images Options
1838
1852
'write-thumbnail ' => $ this ->writeThumbnail ,
1839
1853
'write-all-thumbnails ' => $ this ->writeAllThumbnails ,
1854
+ 'convert-thumbnail ' => $ this ->convertThumbnail ,
1855
+
1840
1856
// Verbosity / Simulation Options
1841
1857
'skip-download ' => $ this ->skipDownload ,
1842
1858
'verbose ' => $ this ->verbose ,
0 commit comments