Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Image CDN to Proxy HEIC / HEIF Images (#33494)
* Allow Image CDN to Proxy HEIC / HEIF Images The backend `Photon_OpenCV` extension actually does build in HEIC support using the following libraries: ``` libheif-decoder.cpp libheif-decoder.h libheif-encoder.cpp libheif-encoder.h ``` What's more it's even allowed by `photon/index.php` because while the `$allowed_types` is currently set as: ``` 49 $allowed_types = apply_filters( 'allowed_types', array( 50 'gif', 51 'jpg', 52 'jpeg', 53 'png', 54 ) ); ``` `libheif` returns `jpeg` as the type for HEIC images: ``` $ wp shell wp> $i = new Photon_OpenCV(); => object(Photon_OpenCV)#4849 (0) { } wp> $i->readimageblob( file_get_contents( 'img.heic' ) ); => NULL wp> $i->getimageformat() => string(4) "jpeg" ``` So all we need to do is to allow `heic` extensions to be passed through Photon. In fact we can test this right now and see that it works as expected: - HEIC: https://xiao.blog/sample.heic - JPEG: https://i0.wp.com/xiao.blog/sample.heic?w=600 * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6482973632
- Loading branch information