DivaVocals / zen_Image-Handler

Image Handler 4 is really meant to ease the management of product images (particularly the management of additional product images), and to help improve page performance by optimizing the product images.
GNU General Public License v2.0
7 stars 13 forks source link

Handling missing images #229

Closed torvista closed 2 years ago

torvista commented 2 years ago

php8, strict mode

I was getting some debugs, which were resulting from images defined in the database but missing, and so undefined values were arriving in includes\functions\extra_functions\functions_bmz_image_handler.php

I find that this scenario does not seem to be handled correctly by IH (it should be handled previously in core, but that's another story).

The check for the existence of the base image is done in calculate_size and if not found, $this->file_exists is set to false; but nothing is done with this variable in the constructor.

I would suggest that immediately subsequent to calculate_size in the constructor, the subsequent code is bypassed based on $this->file_exists = false; and in includes\functions\extra_functions\functions_bmz_image_handler.php a check added based on this if ($ih_image->file_exists) to use a IH local file or bypass and use the original sources (wrong as it is) for core to handle.

That's what I have done, but I don't want to start branching off a PR in progress, so will wait until that is processed.

torvista commented 2 years ago

as per https://github.com/DivaVocals/zen_Image-Handler/pull/232

lat9 commented 2 years ago

I leave these open until release ... otherwise I forget.