Skip to content

Commit

Permalink
Change default quality to 85.
Browse files Browse the repository at this point in the history
Closes #210
  • Loading branch information
ADmad committed Oct 27, 2024
1 parent 1f0873c commit 66b1616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Api/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static function supportedFormats(): array
*/
public function getQuality(): int
{
$default = 90;
$default = 85;
$q = $this->getParam('q');

if (
Expand Down
8 changes: 4 additions & 4 deletions tests/Api/EncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit 66b1616

Please sign in to comment.