-
-
Notifications
You must be signed in to change notification settings - Fork 152
Image: add support for webp #73
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
Conversation
@@ -101,7 +101,8 @@ class Image extends Nette\Object | |||
/** image types */ | |||
const JPEG = IMAGETYPE_JPEG, | |||
PNG = IMAGETYPE_PNG, | |||
GIF = IMAGETYPE_GIF; | |||
GIF = IMAGETYPE_GIF, | |||
WEBP = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar constant for webp does not exist (yet).
Does getimagesizefromstring support WEBP? |
Oh boy of course it does not. :-( |
There is no way to detect webp images in fromString and fromFile (aside from checking file extension in fromFile) so I removed webp from both. But I still think Nette\Utils\Image should be able to generate webp images. |
It is possible via |
Ok, closing for now. Thank you. |
Webp support has been added for PHP 7.1RC4. It should be possible to implement this now. |
Not sure how to write tests - there aren't any tests specific for the other types either.
Also should I check for php version?