diff --git a/src/Options.php b/src/Options.php index cf1ef00..02b2cc8 100644 --- a/src/Options.php +++ b/src/Options.php @@ -150,6 +150,8 @@ class Options // Thumbnail Images Options private bool $writeThumbnail = false; private bool $writeAllThumbnails = false; + private ?string $convertThumbnail = null; + // Verbosity / Simulation Options private bool $skipDownload = false; @@ -1023,6 +1025,18 @@ public function writeThumbnail(bool $writeThumbnail): self return $new; } + /** + * Convert thumbnail to another format. + * @param 'jpg'|'png'|'webp'|null $format + */ + public function convertThumbnail(?string $format): self + { + $new = clone $this; + $new->convertThumbnail = $format; + + return $new; + } + /** * Write all thumbnail image formats to disk. */ @@ -1837,6 +1851,8 @@ public function toArray(): array // Thumbnail Images Options 'write-thumbnail' => $this->writeThumbnail, 'write-all-thumbnails' => $this->writeAllThumbnails, + 'convert-thumbnail' => $this->convertThumbnail, + // Verbosity / Simulation Options 'skip-download' => $this->skipDownload, 'verbose' => $this->verbose,