User tests: Successful: Unsuccessful:
A lot of people will continue to use Joomla 3 for some time, yet they want to use WebP images.
This is a small adjustment to let extensions like media manager accomplish that. Our extensions are using the J4 WebP support for resizing and stuff, and this would be good to offer WebP for all the J3 people still around.
Pull Request for Issue # .
webp Support in Image.php
$fullpath = 'path/to/image.webp';
$fullpath_resized = 'path/to/image_resized.webp';
try {
$image = new Image($fullpath);
} catch (Exception $e) {
return false;
}
$properties = $image->getImageFileProperties($fullpath);
switch ($properties->mime) {
case 'image/webp':
$imageType = \IMAGETYPE_WEBP;
break;
case 'image/png':
$imageType = \IMAGETYPE_PNG;
break;
case 'image/gif':
$imageType = \IMAGETYPE_GIF;
break;
default:
$imageType = \IMAGETYPE_JPEG;
}
$image = $image->cropResize(1024, 768);
$image->toFile($fullpath_resized, $imageType, ['quality' => 85]);
Attempting to load an image of unsupported type WebP
Successful handling of WebP images
Status | New | ⇒ | Pending |
Category | ⇒ | External Library Libraries Composer Change |
It's not about the media manager, but the possibility to use webp inside the J3 image package.
Extensions like media manager means extensions like media manager. So not media manager.
We use the image package to create thumbnails, and it would be good to handle it the same way as in J4 and not outside the workflow.
Please submit to https://github.com/joomla-framework/image/tree/1.x-dev.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-11 19:36:13 |
Closed_By | ⇒ | Quy | |
Labels |
Added:
Composer Dependency Changed
?
|
This is not be complete as you would also need to update the options for the media manager to add webp as a legal file extension and image/webp as a legal mime type.
Actually you can use webp right now with J3 by just updating the options - you just dont get a preview image