Post by cau96176 » Sat May 28, 2022 6:39 pm

HI All,

I realise this is a long shot but there have been a few mods to my site and a bit of codeing edited here and there but I currently have 2 problems.
1. My Slideshow is only displaying broken links to images as it is nameing the all cache/images/blahblah....0x0.jpg
2. My related item thumbnails are not showing either due to the same ....0x0.jpg issue

If I open Google Inspect Item and edit the 0x0 bit to 950x500 which is the image size set in the admin side then the images appear correctly ie:
https://www.sofaking.org.uk/image/cache ... PU-0x0.jpg
to
https://www.sofaking.org.uk/image/cache ... 50x500.jpg

I have checked my error log and I am getting these errors for all the images

2022-05-28 10:31:16 - PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /homepages/23/d548399924/htdocs/v2/system/library/image.php on line 105
URL: /Hilton-Storage-Bed-Single-Brown-Faux-Leather-90cm
REFFER: https://www.sofaking.org.uk/Italia-3-pl ... ored-Glass
------------------------------------------------------------------------------------------------
2022-05-28 10:31:16 - PHP Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in /homepages/23/d548399924/htdocs/v2/system/library/image.php on line 113
URL: /Hilton-Storage-Bed-Single-Brown-Faux-Leather-90cm
REFFER: https://www.sofaking.org.uk/Italia-3-pl ... ored-Glass
------------------------------------------------------------------------------------------------
2022-05-28 10:31:16 - PHP Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /homepages/23/d548399924/htdocs/v2/system/library/image.php on line 116
URL: /Hilton-Storage-Bed-Single-Brown-Faux-Leather-90cm
REFFER: https://www.sofaking.org.uk/Italia-3-pl ... ored-Glass
------------------------------------------------------------------------------------------------
2022-05-28 10:31:16 - PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /homepages/23/d548399924/htdocs/v2/system/library/image.php on line 118
URL: /Hilton-Storage-Bed-Single-Brown-Faux-Leather-90cm
REFFER: https://www.sofaking.org.uk/Italia-3-pl ... ored-Glass

Any ideas?

The lines of code are starting at 105:
$this->image = imagecreatetruecolor($width, $height);

if ($this->mime == 'image/png') {
imagealphablending($this->image, false);
imagesavealpha($this->image, true);
$background = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
imagecolortransparent($this->image, $background);
} else {
$background = imagecolorallocate($this->image, 255, 255, 255);
}

imagefilledrectangle($this->image, 0, 0, $width, $height, $background);

imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->width, $this->height);

New member

Posts

Joined
Sat Feb 01, 2014 11:51 pm

Post by ADD Creative » Sat May 28, 2022 8:19 pm

This is usually caused by a missing or bad theme/extension image size setting. Check all your theme and extension settings. It they all look correct, contact the extension developer.

It it also helpful to post your OpenCart version, PHP version, theme and any extensions you are using.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by cau96176 » Sun May 29, 2022 5:13 pm

Hi,

Thanks for the reply.
Im using V2.3.0.2 on the default theme - that has been played about with over the years.

The extensions I have enabled are
Coupon Checkout Page
Google Tag Manager
Local copy OCMOD by iSenseLabs
PHP Mailer
Power Image Manager
SuperMenu integration OCmod

Also running a Vqmod to add images to the subcategories.

Most of these have been running for years with the exception of Google Tag Manager.

I copied over an original version of the system folder as I found someone had messed around with the system /library /image.php file

If it is a file that is broken - is it more likely to be in the system or catalog folder?

Cheers again.

Michael.

New member

Posts

Joined
Sat Feb 01, 2014 11:51 pm

Post by IP_CAM » Sun May 29, 2022 6:13 pm

You have lots of empty spaces (%20) in your image titles and image links, as it looks:

Code: Select all

https://www.sofaking.org.uk/image/cache/catalog/00img0717/Occasional%20Furnitre/Italia%206%20Drawer%20Chest/Italia%206%20Dr%20Chest%20Room%20Set-0x0.jpg

https://www.sofaking.org.uk/image/cache/catalog/00img0717/Occasional%20Furnitre/Stockwell%20Collection/SKW2BSROE-0x0.jpg

https://www.sofaking.org.uk/image/catalog/300%20Right%20Hand/Order%20Online%20Basket%20150%20x%2080.jpg

https://www.sofaking.org.uk/image/catalog/00img0717/Ashby%20-%20Verona/1327%20Pics%20with%20Handmade/Size%20Silhoutte/Delivery%20Truck.png
Image
empty_spaces_in_image_titles.png

empty_spaces_in_image_titles.png (59.93 KiB) Viewed 328 times


My Github OC Site: https://github.com/IP-CAM
5'200 + 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 cau96176 » Tue May 31, 2022 12:43 am

Thanks...... I've never had an issue with the filenames having spaces - just someone when they were messing around with a sideshow and image sizing has messed up something somewhere - but did they track their changes....... Nope they did not.

Now I'm trying to work backwards to find errors and try to fix them

New member

Posts

Joined
Sat Feb 01, 2014 11:51 pm

Post by Dantheman01 » Sat Aug 13, 2022 1:59 pm

I had an issue out of the blue. I use a hosting service and the images quit working. They were broken. The images didn't show up on the slide show either. It happened on several of my OpenCart installations. They were 3.0 or around there. I did a fresh install with the control panel softaculous. I compared the code and noticed that in the new install the config.php file was home2/ ..... on several of the lines, both in the admin config and the root config. All of my old installs had home1/ . Apparently my host changed something and that is what broke the images. I am just putting this up here in case someone has the same issue. It might save you a lot of time. My host was unaware of any changes like that. I thought they upgraded the php or sql or something. But that was it.

Newbie

Posts

Joined
Sat Aug 13, 2022 7:30 am
Who is online

Users browsing this forum: moreduff and 266 guests