From 66b16169374758688d093ba59e691c7cef327f23 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 27 Oct 2024 20:44:12 +0530 Subject: [PATCH] Change default quality to 85. Closes #210 --- src/Api/Encoder.php | 2 +- tests/Api/EncoderTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Api/Encoder.php b/src/Api/Encoder.php index bef473b..4d42a1f 100644 --- a/src/Api/Encoder.php +++ b/src/Api/Encoder.php @@ -135,7 +135,7 @@ public static function supportedFormats(): array */ public function getQuality(): int { - $default = 90; + $default = 85; $q = $this->getParam('q'); if ( diff --git a/tests/Api/EncoderTest.php b/tests/Api/EncoderTest.php index b3bae46..3def110 100644 --- a/tests/Api/EncoderTest.php +++ b/tests/Api/EncoderTest.php @@ -151,11 +151,11 @@ public function testGetQuality(): void { $this->assertSame(100, $this->encoder->setParams(['q' => '100'])->getQuality()); $this->assertSame(100, $this->encoder->setParams(['q' => 100])->getQuality()); - $this->assertSame(90, $this->encoder->setParams(['q' => null])->getQuality()); - $this->assertSame(90, $this->encoder->setParams(['q' => 'a'])->getQuality()); + $this->assertSame(85, $this->encoder->setParams(['q' => null])->getQuality()); + $this->assertSame(85, $this->encoder->setParams(['q' => 'a'])->getQuality()); $this->assertSame(50, $this->encoder->setParams(['q' => '50.50'])->getQuality()); - $this->assertSame(90, $this->encoder->setParams(['q' => '-1'])->getQuality()); - $this->assertSame(90, $this->encoder->setParams(['q' => '101'])->getQuality()); + $this->assertSame(85, $this->encoder->setParams(['q' => '-1'])->getQuality()); + $this->assertSame(85, $this->encoder->setParams(['q' => '101'])->getQuality()); } /**