Skip to content

Commit ae4c07f

Browse files
authored
Merge pull request #259 from mostafa-norouzi/master
convert-thumbnail switch added
2 parents 83ef03f + 26bb4ca commit ae4c07f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Options.php

+16
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class Options
150150
// Thumbnail Images Options
151151
private bool $writeThumbnail = false;
152152
private bool $writeAllThumbnails = false;
153+
private ?string $convertThumbnail = null;
154+
153155

154156
// Verbosity / Simulation Options
155157
private bool $skipDownload = false;
@@ -1023,6 +1025,18 @@ public function writeThumbnail(bool $writeThumbnail): self
10231025
return $new;
10241026
}
10251027

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+
10261040
/**
10271041
* Write all thumbnail image formats to disk.
10281042
*/
@@ -1837,6 +1851,8 @@ public function toArray(): array
18371851
// Thumbnail Images Options
18381852
'write-thumbnail' => $this->writeThumbnail,
18391853
'write-all-thumbnails' => $this->writeAllThumbnails,
1854+
'convert-thumbnail' => $this->convertThumbnail,
1855+
18401856
// Verbosity / Simulation Options
18411857
'skip-download' => $this->skipDownload,
18421858
'verbose' => $this->verbose,

0 commit comments

Comments
 (0)