As per curiosity, it seems that .webp is becoming more and more like suggested by google pagespeed.
Would IH support .webp format eventually? or even .avif
thank you
Printable View
As per curiosity, it seems that .webp is becoming more and more like suggested by google pagespeed.
Would IH support .webp format eventually? or even .avif
thank you
Hello Lat9! Love the mod. I am starting to add more pictures to products and am noticing that the additional pictures are not being covered by the watermark as well as the regular picture (watermark much smaller). Can this be changed easily? The hover over has great watermarking but the small image without hover does not show the watermarking well.
I've just submitted v5.3.0 of Image Handler for the Zen Cart moderators' review; I'll post back here when it's available for download.
Note: This version of Image Handler requires Zen Cart 1.5.7 or later and has been tested with the current alpha version of Zen Cart 1.5.8 as well as PHP 8.1.
This release contains changes associated with the following GitHub issues:
#248: Correcting PHP 8.0+ Fatal error; casting requires correction.
#251: Correcting products' dropdown sorting for zc158; always sort by products' names.
#252: Correcting PHP Fatal error: Uncaught TypeError: imagecolorallocatealpha(); inputs need to be integers, not floats.
#254: Move installation files to branch root, removing 'Installation Files' sub-directory.
#256: Drop support for Zen Cart versions prior to 1.5.7.
#258: Properly handle corrupt file.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2169
I am getting the following error when IH encounter a .webp file.
This is just an example as i am getting the same log for several other .webp file.Quote:
[27-Oct-2022 00:18:57 UTC] PHP Notice: Image Handler, calculate_size for /images/90674z_11zon.webp returned false; image is corrupt. in /includes/classes/bmz_image_handler.class.php on line 484
I tried to clear the cache thru the admin interface but no change. I understand IH is not compatible with .webp but i thought it would ignore it instead of throwing an error.
Thank you
This is a work around that will allow you to use webp images and not get the error. While lat9 is busy. It is not intended as a final fix.
Modify \includes\classes\observers\ImageHandlerObserver.php
toCode:public function update(&$class, $eventID, $p1, &$p2, &$p3, &$p4, &$p5, &$p6)
{
switch ($eventID) {
This will stop image handler processing your webp images.Code:public function update(&$class, $eventID, $p1, &$p2, &$p3, &$p4, &$p5, &$p6)
{
if (strtolower(right($p1,-5)) == '.webp') {
return;
}
switch ($eventID) {
Just found thad does not work if you have multiple images. This does
Assumes that all images for a product have same extension.Code:public function update(&$class, $eventID, $p1, &$p2, &$p3, &$p4, &$p5, &$p6)
{
if (strtolower($p3) == '.webp') {
return;
}
switch ($eventID) {