I know this is a subject already debated but I'm experiencing the same problem, found a workaround but can't figure out the root cause, and it happens again.
The other posts report identical behavior and there are diferente results but the root cause is not established, and troubleshooting is difficult.
Sorry that I cannot help excepto to post a new question with my specific problem and tests.
Here's what I have:
Opencart 3.0.3.6
Extensions: Purpletree Multivendor, Portuguese (Portugal), SMS.
I configured The extensions and a lot of options in OC and created categories for products.
No errors on the log.
After a while I started getting the error on OC logs but couldn't associate with a single cause, I believe it was when i started adding images to the categories (the images are .jpg 100x100 72ppi).
So here's what I did:
I restored my setup back to 2 days ago, and decided to restore files only, at least for a first test so i didn't restore the database.
I was back to a state before I uploaded and associated the images to the categories.
So everything was working fine and no entries in the log.
Then I added one image to a category, went to and refreshed the home page, and the error in the log came back:
Code: Select all
PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /home/asm/public_html/system/library/image.php on line 169
PHP Warning: imagealphablending() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 172
PHP Warning: imagesavealpha() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 173
PHP Warning: imagecolorallocatealpha() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 174
PHP Warning: imagecolortransparent() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 175
PHP Warning: imagefilledrectangle() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 180
PHP Warning: imagecopyresampled() expects parameter 1 to be resource, bool given in /home/asm/public_html/system/library/image.php on line 182
Removed the image from the category.
Cleared the log
Went to and refreshed the home page.
The error persists.
So another thought, maybe it's cached.
So went into extensions, cleared and rebuild, went to dashboard, cleared template and SASS cache, went to channel, deleted all the content in cache directory.
Went to and refreshed the home page.
The error persists.
Everything is working ok, even with the images in the categories and the errors in the log, but these entries have two major impacts:
1 - each time a log is written I/O is wasted, a problem still exists, CPU cycles are wasted and performance is afected specially noticeable in high traffic
2 - if there is another relevant error message, for some other reason, that requires analysis, it'll be almost impossible to detect as the log is cluttered with image error messages, at this point garbage.
So my question is:
where the heck is the image registered or what is OC trying to do that generates this error, and what to do solve this ?
In this original post there was some information missing that i'll add here:
- Problem related to the theme and empty values - I found some posts and threads with some sugestions name the only suggested by "sw!tch" regarding the problem related to the theme and empty values.
viewtopic.php?t=208342#p740268, however i could not find in the theme any configuration values empty or non numeric. - Using default Opencart theme
- Link to the site where it happens: https://test.asminhascompras.pt/ - I also have a uat and a production site where this also happens, those have less configurations and extensions.
Peteredhair