Skip to content

Commit

Permalink
SA
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-janu committed Jul 2, 2024
1 parent 0cb67f5 commit ab37c89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 8
level: 'max'
paths:
- src

Expand Down
5 changes: 3 additions & 2 deletions src/Picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ public function resize(

try {
$image = Image::fromFile($mainFile);
// @phpstan-ignore-next-line
$image->resize($width, $height, $flag);

if ($this->sharpenAfterResize) {
$image->sharpen();
}

$resource = $image->getImageResource();
if (in_array($extension, ['jpg', 'jpeg'], true) && $resource instanceof GdImage) {
if (in_array($extension, ['jpg', 'jpeg'], true)) {
imageinterlace($resource, true);
} // Progressive JPEG

Expand Down Expand Up @@ -249,7 +250,7 @@ public function blur(string $file, int $depth = 10): string
$image = Image::fromFile($mainFile);

$resource = $image->getImageResource();
if (in_array($extension, ['jpg', 'jpeg'], true) && $resource instanceof GdImage) {
if (in_array($extension, ['jpg', 'jpeg'], true)) {
imageinterlace($resource, true);
} // Progressive JPEG

Expand Down

0 comments on commit ab37c89

Please sign in to comment.