[wp-trac] [WordPress Trac] #35725: Add mime-type for Webp
WordPress Trac
noreply at wordpress.org
Thu Dec 14 21:38:30 UTC 2017
#35725: Add mime-type for Webp
--------------------------+------------------------------
Reporter: markoheijnen | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by blobfolio):
PHP support for WebP is starting to catch up. I'd like to investigate
whether or not it is feasible to expand this enhancement to include
thumbnail generation support as well.
I'll dive deeper in the next week or so and update the patch accordingly,
but in the meantime, here are a few references:
GD and EXIF support:
* https://php.net/manual/en/function.imagecreatefromwebp.php (PHP 5.5)
* https://php.net/manual/en/function.imagewebp.php (PHP 5.5)
* https://secure.php.net/manual/en/function.exif-imagetype.php (PHP 7.1)
The output from `gd_info()` should include `['WebP Support']=>true` under
environments that support WebP.
Imagick can be compiled with WebP support (e.g. with `libwebp-dev`, etc.).
This does not seem to be very common yet, but we could conditionally check
the response of `Imagick::queryFormats('WEBP')`; a non-empty `array()`
being Yay!, an empty one being Boo!
* http://www.imagemagick.org/script/formats.php
* https://www.imagemagick.org/script/webp.php
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35725#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list