Page 1 of 1
Invalid image dimensions in image.php on line 105
Posted: Mon Mar 07, 2016 11:19 am
by gnurob
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
Re: Invalid image dimensions in image.php on line 105
Posted: Tue Mar 08, 2016 8:41 pm
by gnurob
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?
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Mar 09, 2016 9:36 am
by gnurob
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...
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Mar 09, 2016 2:59 pm
by opencartboost
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'));
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Mar 09, 2016 3:52 pm
by pm-netti
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'.
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Mar 09, 2016 7:12 pm
by pm-netti
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);
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Mar 09, 2016 11:57 pm
by Daniel
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?
Re: Invalid image dimensions in image.php on line 105
Posted: Thu Mar 10, 2016 12:21 am
by pm-netti
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

Re: Invalid image dimensions in image.php on line 105
Posted: Sun Mar 13, 2016 12:50 am
by qahar
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.
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Oct 26, 2016 2:11 pm
by macparts
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.
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Nov 16, 2016 9:11 am
by matt71
@macparts,
You wouldn't happen to be running Manufacturer Extended extension, would you?
Matt
Re: Invalid image dimensions in image.php on line 105
Posted: Tue Dec 04, 2018 3:38 am
by commissionit
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
Re: Invalid image dimensions in image.php on line 105
Posted: Tue Dec 04, 2018 9:59 pm
by IP_CAM
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
Re: Invalid image dimensions in image.php on line 105
Posted: Tue Jul 02, 2019 10:52 pm
by lediona
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
Re: Invalid image dimensions in image.php on line 105
Posted: Wed Jul 03, 2019 4:45 am
by thekrotek
Contact extension developer and ask him to look into your issue.