Upgrade to 4.3.0
This commit is contained in:
@@ -116,15 +116,33 @@ class SimpleImage
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
if ($this->image instanceof GdImage) {
|
||||
imagedestroy($this->image);
|
||||
}
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Checks if the SimpleImage object has loaded an image.
|
||||
*/
|
||||
public function hasImage(): bool
|
||||
{
|
||||
return $this->image instanceof GdImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the image resource.
|
||||
*/
|
||||
public function reset(): static
|
||||
{
|
||||
if ($this->hasImage()) {
|
||||
imagedestroy($this->image);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set flag value.
|
||||
*
|
||||
@@ -313,7 +331,7 @@ class SimpleImage
|
||||
*
|
||||
* @throws Exception Thrown when WEBP support is not enabled or unsupported format.
|
||||
*/
|
||||
protected function generate(string $mimeType = null, array|int $options = []): array
|
||||
public function generate(string $mimeType = null, array|int $options = 100): array
|
||||
{
|
||||
// Format defaults to the original mime type
|
||||
$mimeType = $mimeType ?: $this->mimeType;
|
||||
|
Reference in New Issue
Block a user