Post by koc2018 » Sat Nov 17, 2018 3:21 pm

Version 3.0.2.0

This sounds strange, but, I created an pretty empty theme (I want to customize it later), and set my store to use this new theme. All looks ok.
However, whenever I try to access a product / category page, at the top of the page, it shows error like:

Warning: imagecreatetruecolor(): Invalid image dimensions in /var/www/html/mystore/system/library/image.php on line 169Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 177Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 180Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 182Warning: imagecreatetruecolor(): Invalid image dimensions in /var/www/html/mystore/system/library/image.php on line 169Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 177Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 180Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /var/www/html/mystore/system/library/image.php on line 182Warning: Division by zero in /var/www/html/mystore/catalog/controller/product/category.php on line 332

If I switch the theme back to the default one, then the error is gone.

Anyone know how should I trouble shoot it? (PS, when the error is there, the expected product images won't show up)

Thanks!

New member

Posts

Joined
Mon Oct 01, 2018 1:45 pm

Post by ocmta » Sat Nov 17, 2018 11:04 pm

In admin, go to Extensions - Themes - Edit page for your theme and make sure that none of the values are empty or zero.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by koc2018 » Sun Nov 18, 2018 9:40 am

:)
Thanks ocmta! I think you got the right answer, though slightly different in my case is that, I found out the values (at the place you mentioned) are not saved to db, possible due to a wrong code in my own ControllerExtensionThemeMyTheme.

Thank you!

New member

Posts

Joined
Mon Oct 01, 2018 1:45 pm

Post by jpernas » Tue Nov 12, 2019 4:53 pm

  • Same error in lines 169, 177, 180 and 182 of the /system/library/image.php.
  • Same version of OC (3.0.2.0)
...and I solved it.

One more "detail": I'm using the Journal 3 Theme. (In fact, I am moving from Journal 2 to Journal 3)

Well... the mistake was to disable the default theme in the extensions of Opencart (in Extensions / Themes) There are defined the image with and height that image.php needs.

The solution (at least in my case): I simply enabled again the default theme.

Image
hosting imagenes

I hope it will help you.

Jesús P. A.
__________________
SEO Coruña
Enjoying OC 3.0.2


User avatar
Newbie

Posts

Joined
Mon Jun 06, 2016 4:56 pm

Post by Live_Life » Fri Jul 14, 2023 4:48 am

jpernas , I give you a big thumbs up. I got this error Warning: imagecolorallocate() expects exactly 4 parameters, 5 given in the library/image.php.
Until I hit your post, everyone else's posts that I was reading were saying check to make sure my dimensions in your theme or other extensions. Of course, nothing wrong with the dimensions, since I hadn't touched them in developing my own theme.
Guess: There are images in your image manager that use the default theme dimensions. It may be solved by deleting original images from the original default theme in your image manager. Re-upload any original images that you need into your new theme. Then you can probably disable or uninstall the default theme.

Eventually I will get to testing this out, and hopefully be able to tell you if it works. Right now, having the default theme enabled does away with the error.
Thanks jpernas

Newbie

Posts

Joined
Sat Apr 22, 2023 3:10 am
Who is online

Users browsing this forum: No registered users and 21 guests