Skip to content

Commit d9c219d

Browse files
committed
remove the speed parameter
1 parent 10211ca commit d9c219d

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

system/Images/Handlers/BaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ abstract public function getVersion();
683683
*
684684
* @return bool
685685
*/
686-
abstract public function save(?string $target = null, int $quality = 90, int $speed = -1);
686+
abstract public function save(?string $target = null, int $quality = 90);
687687

688688
/**
689689
* Does the driver-specific processing of the image.

system/Images/Handlers/GDHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ protected function process(string $action)
202202
*
203203
* @param non-empty-string|null $target
204204
*/
205-
public function save(?string $target = null, int $quality = 90, int $speed = -1): bool
205+
public function save(?string $target = null, int $quality = 90): bool
206206
{
207207
$original = $target;
208208
$target = ($target === null || $target === '') ? $this->image()->getPathname() : $target;
@@ -275,7 +275,7 @@ public function save(?string $target = null, int $quality = 90, int $speed = -1)
275275
throw ImageException::forInvalidImageCreate(lang('Images.avifNotSupported'));
276276
}
277277

278-
if (! @imageavif($this->resource, $target, $quality, $speed)) {
278+
if (! @imageavif($this->resource, $target, $quality)) {
279279
throw ImageException::forSaveFailed();
280280
}
281281
break;

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ protected function supportedFormatCheck()
324324
*
325325
* @throws ImagickException
326326
*/
327-
public function save(?string $target = null, int $quality = 90, int $speed = -1): bool
327+
public function save(?string $target = null, int $quality = 90): bool
328328
{
329329
$original = $target;
330330
$target = ($target === null || $target === '') ? $this->image()->getPathname() : $target;

tests/system/Images/GDHandlerTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,7 @@ public function testImageCopyWithNoTargetAndMaxQuality(): void
363363
{
364364
foreach (['gif', 'jpeg', 'png', 'webp', 'avif'] as $type) {
365365
$this->handler->withFile($this->origin . 'ci-logo.' . $type);
366-
if ($type === 'avif') {
367-
$this->handler->save(null, 100, 10);
368-
} else {
369-
$this->handler->save(null, 100);
370-
}
366+
$this->handler->save(null, 100);
371367
$this->assertFileExists($this->origin . 'ci-logo.' . $type);
372368

373369
$this->assertSame(

0 commit comments

Comments
 (0)