Error message on search page, caused by large image.

  • Posts: 13
  • Thank you received: 0
6 years 6 months ago #280709

-- url of the page with the problem -- : www.sukrin.nl/component/search/?searchwo...ase=all&limitstart=0
-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.8.1
-- PHP version -- : 7.1.10
-- Browser(s) name and version -- : Not relevant.
-- Error-message(debug-mod must be tuned on) -- : WARNING_IMAGE_TOO_BIG_FOR_MEMORY

Hi,

We were hit with the error message WARNING_IMAGE_TOO_BIG_FOR_MEMORY in the search results. This was caused by somewhat big image.

The calculation you apply in administrator/components/com_hikashop/helpers/image.php is this:

$estimation = (($origin->width * $origin->height) + ($e_x * $e_y)) * 8;
The image is 6778x4524 in dimensions. Meaning that you calculate roughly 250MB for the resize. The original image is 5.2M

There are a couple problems:
  • That calculation is very rough, I think 8 times the size of the image is to much, it should be set to something lower.
  • There are no thumbnails in the search result, so the check is hit at the wrong time
  • The function is guarded with a image_check_memory config option, but there is no corresponding GUI setting

I've now set that config option to false to not hit this error message, but should be fixed so we don't overwrite it on the next update.

Last edit: 6 years 6 months ago by kovoks.

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
6 years 6 months ago #280712

Hi,

- The orginal image is compressed. When PHP loads the image in memory, it uncompresses it in a raw format, and thus, it uses 8 bits of memory for each pixel in the image. So no, it's totally normal. Note that this check is in place to avoid fatal error messages, so that you get a more meaningful message and not a blank page.

- Even if there are no thumbnails on the search results, the images thumbnails are still computed because some alternatives to the Joomla default search system ask for the URL of the thumbnails in the returned results of the search plugins. For example, the extension extensions.joomla.org/extension/universal-ajax-live-search/ has an ajax search module which uses the thumbnails even though it uses the standard search triggers of Joomla.
And the plugins have no way of knowing who is calling for the search so it always compute the thumbnails: in fact it only computes it once and once generated, it will directly give the link, without having to regenerate the thumbnail.

- That's on purpose. We've added a hidden parameter when we added that check so that if someone had a special case we didn't thought of, they would be able to disable the check by adding an entry to the table hikashop_config. And you won't loose that setting in the database with the updates. Once a setting is in hikashop_config, it's not replaced, like we don't change your configuration settings values when you update HikaShop, unless there is a really really good reason for it.
It's the same as the difference between the options interface of your browser, and the about:config page which has a huge table of parameters that usually you don't want to change but you still can.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
6 years 6 months ago #280771

Thanks a lot for your detailled explanation. Makes a lot of sense now. Thanks for taking the time to look at this issue.

Please Log in or Create an account to join the conversation.

Time to create page: 0.038 seconds
Powered by Kunena Forum