Re: Hover image alignment
Quote:
Originally Posted by
brittainmark
Think I might have found it.
Try altering includes/functions/extra_functions/functions_bmz_image_handler.php
about line 114 from
Code:
function handle_image($src, $alt, $width, $height, $parameters)
{
global $ihConf;
if ($ihConf['resize']) { //Image Handler processing is enabled
to
Code:
function handle_image($src, $alt, $width, $height, $parameters)
{
global $ihConf;
$image_ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
if ($ihConf['resize'] && ($image_ext != 'webp')) { //Image Handler processing is enabled
Sorry for the delay to report.
When i first tried to alter includes/functions/extra_functions/functions_bmz_image_handler.php, the link to the .webp image appeared broken.
However, i forgot i reverted the previous change to the observer.
After altering both files, the .webp error seems to be gone ( at least in the last 2 days )
Thank you to brittainmark for providing the fix.
Now, I am facing another "bug" thatmay or may not be related to IH:
If i use a .webp image for a banner, the image is being resized to my small image admin settings.
If i use a jpg, png...image for the same banner, the image is display to the image initial size.
Is this a normal behavior? I didn't know that IH and/or ZC would resize .webp image when use in banners.
Is there a way to fix it?
Thank you
Re: Hover image alignment
The changes I suggested to image handler mean that it does not touch images with the extension .webp therefore I would suggest it is another issue unless image handler was changing the jpeg/gif image to a new size. If you look at a none webp image, what is the image name in the banner?
Re: Hover image alignment
Quote:
Originally Posted by
brittainmark
The changes I suggested to image handler mean that it does not touch images with the extension .webp therefore I would suggest it is another issue unless image handler was changing the jpeg/gif image to a new size. If you look at a none webp image, what is the image name in the banner?
My apologies. The change you suggested are working.
It appears to be different issue but it still involves.webp images unfortunately as far as I can tell.
The banner can be seen at royal-fleurdotcom.
The image is named fall banner.jpg with a resolution of 900 x 360.
If I use fall banner.webp with same resolution, it gets resized to 400x150 with 400 being my max small image width.
Not sure why it is doing itor if it is IH entirely related. Other .webp image are fine except when it comes to banner.
Re: Hover image alignment
Quote:
Originally Posted by
nicksab
My apologies. The change you suggested are working.
It appears to be different issue but it still involves.webp images unfortunately as far as I can tell.
The banner can be seen at royal-fleurdotcom.
The image is named fall banner.jpg with a resolution of 900 x 360.
If I use fall banner.webp with same resolution, it gets resized to 400x150 with 400 being my max small image width.
Not sure why it is doing itor if it is IH entirely related. Other .webp image are fine except when it comes to banner.
If IH isn't managing the image (per @brittainmark's suggested change), then it's not involved in anything to do with the associated image ... although it looks like you've got it sorted out. What changed?
Re: Hover image alignment
Quote:
Originally Posted by
lat9
If IH isn't managing the image (per @brittainmark's suggested change), then it's not involved in anything to do with the associated image ... although it looks like you've got it sorted out. What changed?
The suggested change by brittainmark took care of the .webp issues and IH is not throwing errors anymore when encountering this format.
I haven t figure out the banner part yet and reverted tousing .jpg image for now. Not sure why it is behaving this and will have to experiment a bit more. For now, image in .webp in banner are resized to small image setting from admin.
I am not sure if it is IH related either. JPG image are not resized and are displayed to their uploaded size when used in banners.
Re: Hover image alignment
Image Handler 5, v5.3.1 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2169
This release contains changes associated with the following GitHub issues:
#263: Define all class variables, PHP 8.2+ requirement.
#265: Don't process images, e.g. those with a .webp extension, that aren't resizeable via PHP built-in functions.
Re: Hover image alignment
ZC v1.5.8
The background colour of small images is set, in IH5, by specifying SMALL_IMAGE_BACKGROUND in Admin. I use this feature and it works well for my Product Listing pages but I would like to set a different background colour for those small images that appear on the product_info pages, namely additional images.
How would I go about setting this up for additional images? An acceptable, and possibly easier, alternative would be to set a different background color for ALL images on the product_info page.
Edit: should not have replied to 'Re: Hover image alignment' post
Re: Hover image alignment
I had thought something like this, in \includes\functions\extra_functions\functions_bmz_image_handler.php to use the MEDIUM_IMAGE_BACKGROUND colour for small images on product_info pages
Code:
global $current_page_base;
if ($current_page_base == ('product_info')) {
$ihConf['small']['bg'] = defined('MEDIUM_IMAGE_BACKGROUND') ? MEDIUM_IMAGE_BACKGROUND : $ihConf['default']['bg'];
} else {
$ihConf['small']['bg'] = defined('SMALL_IMAGE_BACKGROUND') ? SMALL_IMAGE_BACKGROUND : $ihConf['default']['bg'];
}
but no.
Re: Hover image alignment
Quote:
Originally Posted by
simon1066
I had thought something like this, in \includes\functions\extra_functions\functions_bmz_image_handler.php to use the MEDIUM_IMAGE_BACKGROUND colour for small images on product_info pages
Code:
global $current_page_base;
if ($current_page_base == ('product_info')) {
$ihConf['small']['bg'] = defined('MEDIUM_IMAGE_BACKGROUND') ? MEDIUM_IMAGE_BACKGROUND : $ihConf['default']['bg'];
} else {
$ihConf['small']['bg'] = defined('SMALL_IMAGE_BACKGROUND') ? SMALL_IMAGE_BACKGROUND : $ihConf['default']['bg'];
}
but no.
Actually, there's no way that would have worked.
Re: Hover image alignment
@simon1066, are you using any of the URL manglers (e.g. USU or Ceon URI Mappings). There might be a relatively easy to accomplish what you're looking to do if you're not.