Post by gnurob » Mon Mar 07, 2016 11:19 am

Product images are not appearing in categories, and many PHP errors are appearing at the top of the page. Interesting to note, the product image URLs are broken in an unusual way. In the following HTML output (cut for size), the filename is missing the height portion of the file name (see correct file in bold).

Code: Select all

<div class="product-layout product-list col-xs-12">
<div class="product-thumb">
<div class="image">
<a href="http://www.server.com/store/index.php?...">
<img src="image/cache/catalog/filename-228x.png" class="img-responsive" /></a>
...
Checking the filesystem, the correct image file is filename-228x228.png.

As for the PHP errors:

On the top of the page output:

Code: Select all

Warning: imagecreatetruecolor(): Invalid image dimensions in /html/store/system/library/image.php on line 105Warning: imagealphablending() expects parameter 1 to be resource, boolean given in /html/store/system/library/image.php on line 108Warning: imagesavealpha() expects parameter 1 to be resource, boolean given in /html/store/system/library/image.php on line 109
...plus many more
In the error.log:

Code: Select all

2016-03-07 1:02:26 - PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /html/store/system/library/image.php on line 105
2016-03-07 1:02:26 - PHP Warning:  imagealphablending() expects parameter 1 to be resource, boolean given in /html/store/system/library/image.php on line 108
2016-03-07 1:02:26 - PHP Warning:  imagesavealpha() expects parameter 1 to be resource, boolean given in /html/store/system/library/image.php on line 109
...and again, many more

Newbie

Posts

Joined
Mon Mar 07, 2016 11:05 am

Post by gnurob » Tue Mar 08, 2016 8:41 pm

I can't find the source of this bug. Is anyone else experiencing this issue? ...does OpenCart require thumbnails to be resized before upload? ...or maybe there is a required PHP library that is not installed, and not generating an error?

Any suggestions?

Newbie

Posts

Joined
Mon Mar 07, 2016 11:05 am

Post by gnurob » Wed Mar 09, 2016 9:36 am

System, Users, User Groups, Administrator: grant permission to access and modify the theme

Extensions, Themes, click edit, then save.

No idea why this would come out of the box like this...

Newbie

Posts

Joined
Mon Mar 07, 2016 11:05 am

Post by opencartboost » Wed Mar 09, 2016 2:59 pm

Can you show code for resize image at file controller?
Please note :
Opencart 2.2.0.0 have different code with older version for image resize, example
code for 2.2.0.0 like this :

Code: Select all

$image = $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
and for older version is like this :

Code: Select all

$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));

Active Member

Posts

Joined
Thu Jul 09, 2015 5:59 am

Post by pm-netti » Wed Mar 09, 2016 3:52 pm

gnurob wrote:I can't find the source of this bug. Is anyone else experiencing this issue? ...does OpenCart require thumbnails to be resized before upload? ...or maybe there is a required PHP library that is not installed, and not generating an error?

Any suggestions?
Are you install images width & height?

http://forum.opencart.com/viewtopic.php?f=190&t=159126

Ps. This it is theme autors new jobs. Theme authors need create theme setting files admin/controller/theme/theme_xxxx.php, admin/view/template/theme/theme_xxxx.tpl and admin/language/*/theme/theme_xxx.php

Ps 2: My test this is not can change theme. This line 60 in file loader.php add automaticilly prefix 'default/template/':

Code: Select all

$result = $this->registry->get('event')->trigger('view/' . $route . '/before', array(&$route, &$data));
I have in use test theme 'peku'.
Last edited by pm-netti on Wed Mar 09, 2016 7:43 pm, edited 2 times in total.

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by pm-netti » Wed Mar 09, 2016 7:12 pm

It is this temporary solution, file system/library/template.php lines 19,20:

Code: Select all

$template = str_replace('default','peku',$template);
		return $this->adaptor->render($template);

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Daniel » Wed Mar 09, 2016 11:57 pm

what about when you go to admin > extension > theme > Default Store Theme

then set the field Theme Directory to the name of the custom theme?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by pm-netti » Thu Mar 10, 2016 12:21 am

Daniel wrote:what about when you go to admin > extension > theme > Default Store Theme

then set the field Theme Directory to the name of the custom theme?
Thanks! This is work!
Here it is possible to add your own theme configuration files, but they are not yet able to use ;D

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by qahar » Sun Mar 13, 2016 12:50 am

As a note, this dimension image issue also happen when theme you choose at system > setting have status disabled on extensions > themes.

So make sure to never disabled your active theme.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by macparts » Wed Oct 26, 2016 2:11 pm

Did anyone find a solution to this problem?

I have the same error. When I click on a top category I get these errors on top of the page

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/macparts/public_html/ocn/system/library/image.php on line 105Warning: imagealphablending() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 108Warning: imagesavealpha() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 109Warning: imagecolorallocatealpha() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 110Warning: imagecolortransparent() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 111Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 116Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/macparts/public_html/ocn/system/library/image.php on line 118

I have OC 2.2.0.0 and vqmod 2.5.1

Thank you.

Newbie

Posts

Joined
Wed Oct 26, 2016 3:34 am

Post by matt71 » Wed Nov 16, 2016 9:11 am

@macparts,

You wouldn't happen to be running Manufacturer Extended extension, would you?

Matt

New member

Posts

Joined
Sat Jan 19, 2013 4:13 am

Post by commissionit » Tue Dec 04, 2018 3:38 am

Hi

I am also having the same issue, willing to pay someone $20 you can fix it for me ASAP?

Seems to happen when i upload new data feeds: e.g.
https://www.commissionit.co.uk/personal ... cat=plants

Strange thing is if you do a refresh it fixes the issue...

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/abstrac0/public_htm_commission/wp-includes/media.php on line 2836

Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/abstrac0/public_htm_commission/wp-includes/class-wp-image-editor-gd.php on line 183

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/abstrac0/public_htm_commission/wp-includes/media.php on line 2836

Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/abstrac0/public_htm_commission/wp-includes/class-wp-image-editor-gd.php on line 183

Thanks

Newbie

Posts

Joined
Tue Dec 04, 2018 3:35 am

Post by IP_CAM » Tue Dec 04, 2018 9:59 pm

Well, that's WORDPRESS Code, and has nothing to do with Opencart.
Ernie
---

Code: Select all

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/abstrac0/public_htm_commission/wp-includes/media.php on line 2836
Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/abstrac0/public_htm_commission/wp-includes/class-wp-image-editor-gd.php on line 183
Warning: imagecreatetruecolor(): Invalid image dimensions in /home/abstrac0/public_htm_commission/wp-includes/media.php on line 2836
Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/abstrac0/public_htm_commission/wp-includes/class-wp-image-editor-gd.php on line 183

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by lediona » Tue Jul 02, 2019 10:52 pm

Guys please tell me how to fix this error.
It displays only in the product page after installing Ajax Quick Chekcout. I disabled it later but the errors are still the same. Im using Open Cart 3.0.2.0. I ve tried clearing the cache, go to themes and click save, changing the default theme directory file but still the same.

Thanks

Newbie

Posts

Joined
Wed Jun 05, 2019 3:46 pm

Post by thekrotek » Wed Jul 03, 2019 4:45 am

Contact extension developer and ask him to look into your issue.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: vanson_jackets and 33 guests