Skip to content

Commit

Permalink
Merge pull request #402 from thephpleague/feat/default-quality
Browse files Browse the repository at this point in the history
Change default quality to 85.
  • Loading branch information
ADmad authored Oct 27, 2024
2 parents 1f0873c + 66b1616 commit 2faf000
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 2faf000

Please sign in to comment.