Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIFF support #159

Merged
merged 7 commits into from
Feb 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update format list to use constants, and add TIFF format if we are us…
…ing imagick
Synchro committed Feb 20, 2022

Verified

This commit was signed with the committer’s verified signature.
Synchro Marcus Bointon
commit e70aa8d4c63d11deba3d9c67763d1553fb0a22ad
13 changes: 12 additions & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
@@ -171,7 +171,18 @@ protected function addFormatManipulation($outputPath): void
return;
}

$supportedFormats = ['jpg', 'pjpg', 'png', 'gif', 'webp', 'avif'];
$supportedFormats = [
Manipulations::FORMAT_JPG,
Manipulations::FORMAT_PJPG,
Manipulations::FORMAT_PNG,
Manipulations::FORMAT_GIF,
Manipulations::FORMAT_WEBP,
Manipulations::FORMAT_AVIF,
];
Comment on lines +174 to +181
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

//gd driver doesn't support TIFF
if ($this->imageDriver === 'imagick') {
$supportedFormats[] = Manipulations::FORMAT_TIFF;
}

if (in_array($outputExtension, $supportedFormats)) {
$this->manipulations->format($outputExtension);