Skip to content

Commit 788858b

Browse files
authored
Add convert() to BaseHandler
1 parent ed72b07 commit 788858b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

system/Images/Handlers/BaseHandler.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,22 @@ public function crop(int $width = null, int $height = null, int $x = null, int $
286286

287287
//--------------------------------------------------------------------
288288

289+
/**
290+
* Changes the stored image type to indicate the new file format to use when saving.
291+
* Does not touch the actual resource.
292+
*
293+
* @param integer|null $imageType A PHP imageType constant, e.g. https://www.php.net/manual/en/function.image-type-to-mime-type.php
294+
*
295+
* @return $this
296+
*/
297+
public function convert(int $imageType)
298+
{
299+
$this->image->imageType = $imageType;
300+
return $this;
301+
}
302+
303+
//--------------------------------------------------------------------
304+
289305
/**
290306
* Rotates the image on the current canvas.
291307
*

0 commit comments

Comments
 (0)