Page 1 of 1

[SOLVED] Images are not uploading for cache folder.

Posted: Mon May 31, 2021 2:36 pm
by esigners
Hello,
I am working 1st time on Opencart. From back end when I upload any image (product, manufacturer) using the default popup image manager, it is showing image is uploaded and then showing broken image. Here is the screen shot.
https://ibb.co/DD1rs69

Once I login to the FTP and checked - the image is uploaded inside the 'image/catalog' folder properly but unable to upload 'image/cache/catalog' folder.
Using firebug I see that all images from back end to front are called from cache folder. I have already set cache folder permission to 777 but nothing helps. Please suggest to how to resolve this issue. Is there any way to disable image cache permanently so that images will be called directly from 'image/catalog' folder, not from cache folder?
Tanks.

Re: Images are not uploading for cache folder.

Posted: Mon May 31, 2021 5:11 pm
by wrick0
are you sure your php settings are correct? upload_max_file_size etc. ? check your error logs (webserveR)

Re: Images are not uploading for cache folder.

Posted: Mon May 31, 2021 6:29 pm
by straightlight
esigners wrote:
Mon May 31, 2021 2:36 pm
Hello,
I am working 1st time on Opencart. From back end when I upload any image (product, manufacturer) using the default popup image manager, it is showing image is uploaded and then showing broken image. Here is the screen shot.
https://ibb.co/DD1rs69

Once I login to the FTP and checked - the image is uploaded inside the 'image/catalog' folder properly but unable to upload 'image/cache/catalog' folder.
Using firebug I see that all images from back end to front are called from cache folder. I have already set cache folder permission to 777 but nothing helps. Please suggest to how to resolve this issue. Is there any way to disable image cache permanently so that images will be called directly from 'image/catalog' folder, not from cache folder?
Tanks.
OC version. Never to be set o n 0777. 0755 should be the highest recursively on specified folders from the install text file in the OC ZIP file downloaded from opencart.com .

Re: Images are not uploading for cache folder.

Posted: Tue Nov 15, 2022 5:21 pm
by okeystm
No one ? Really? Same issue here . One day just stoped creating other image sizes for thumbnails . Deleted cache folder and I end up with no images at all on my products. So no cache images in folders. But one somehow have created product image in cache folder for only one product . Still no other image sizes for other thumbnails.

Re: Images are not uploading for cache folder.

Posted: Tue Nov 15, 2022 5:51 pm
by ADD Creative
okeystm wrote:
Tue Nov 15, 2022 5:21 pm
No one ? Really? Same issue here . One day just stoped creating other image sizes for thumbnails . Deleted cache folder and I end up with no images at all on my products. So no cache images in folders. But one somehow have created product image in cache folder for only one product . Still no other image sizes for other thumbnails.
Check both your OpenCart and PHP error logs.

Cache Images are only created as needed so you would need to go to the product page for OpenCart to create the respective images. Other caches could affect this process.

Re: Images are not uploading for cache folder.

Posted: Tue Jan 03, 2023 12:17 am
by ocjimmy
Check your version of PHP. I recently upgraded the PHP version from 7.3 to 8.1. I thought everything was working but had not tried uploading a catalog image. With version 8.1, it was not creating the thumbnail in the cache folder. I reverted back to 7.3 and everything is working again.

I have not yet had a chance to debug the cache image creation but suspect there is a missing PHP module in version 8.1 that is present in 7.3. (i.e. the module that opencart uses to create thumbnails?)

Re: Images are not uploading for cache folder.

Posted: Fri Nov 10, 2023 11:19 pm
by emprisestar
I think GD Library does not work. So in the file \admin\model\tool\image.php, at line 31:
Above this line : if ($width_orig != $width || $height_orig != $height) {
Add a new line code as below:
copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

Enjoy it.
Hoang D.
@minhhoangduc from freelancer.com

Re: Images are not uploading for cache folder.

Posted: Fri Jan 26, 2024 5:44 pm
by Elstor
emprisestar wrote:
Fri Nov 10, 2023 11:19 pm
I think GD Library does not work. So in the file \admin\model\tool\image.php, at line 31:
Above this line : if ($width_orig != $width || $height_orig != $height) {
Add a new line code as below:
copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

Enjoy it.
Hoang D.
@minhhoangduc from freelancer.com
It was a good solution. My problem is that uploaded images are not converted to the correct size, for example in the search box or where small images we use. The images are used from the cache folder, the image title would be correct (https://elstor.no/image/cache/catalog/DEL120-60x60.jpg) but the original size remains. we using Opencart 3.0.3.2, Journal V3 theme, PHP8.0
Have you any ideas to solve this problem?
Thank you!

Re: Images are not uploading for cache folder.

Posted: Fri Jan 26, 2024 6:22 pm
by ADD Creative
Elstor wrote:
Fri Jan 26, 2024 5:44 pm
emprisestar wrote:
Fri Nov 10, 2023 11:19 pm
I think GD Library does not work. So in the file \admin\model\tool\image.php, at line 31:
Above this line : if ($width_orig != $width || $height_orig != $height) {
Add a new line code as below:
copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

Enjoy it.
Hoang D.
@minhhoangduc from freelancer.com
It was a good solution. My problem is that uploaded images are not converted to the correct size, for example in the search box or where small images we use. The images are used from the cache folder, the image title would be correct (https://elstor.no/image/cache/catalog/DEL120-60x60.jpg) but the original size remains. we using Opencart 3.0.3.2, Journal V3 theme, PHP8.0
Have you any ideas to solve this problem?
Thank you!
That's what that modification does. It will just copy the image if the resize doesn't work. OpenCart 3.0.3.2 in not fully compatible with PHP 8. One of the fixes added in later versions was a PHP 8 compatibility fix for image resizing.

https://github.com/opencart/opencart/co ... 9abe8229ce

Re: Images are not uploading for cache folder.

Posted: Fri Jan 26, 2024 6:25 pm
by IP_CAM
It was a good solution. My problem is that uploaded images are not converted to the correct size, for example in the search box or where small images we use. The images are used from the cache folder, the image title would be correct (https://elstor.no/image/cache/catalog/DEL120-60x60.jpg) but the original size remains. we using Opencart 3.0.3.2, Journal V3 theme, PHP8.0
Have you any ideas to solve this problem?
Thank you!
Well, your posting has been replied to already, if you're a legal Journal Theme User, you could contact Journal on this, or then, just better don't expect free assistance around here on such.
viewtopic.php?t=232933

Re: Images are not uploading for cache folder.

Posted: Fri Jan 26, 2024 6:57 pm
by paulfeakins
Elstor wrote:
Fri Jan 26, 2024 5:44 pm
we using Opencart 3.0.3.2, Journal V3 theme, PHP8.0
As above, OC 3.0.3.2 is not compatible with PHP 8.

Re: Images are not uploading for cache folder.

Posted: Sun Jan 28, 2024 2:01 am
by Elstor
ADD Creative wrote:
Fri Jan 26, 2024 6:22 pm
Elstor wrote:
Fri Jan 26, 2024 5:44 pm
emprisestar wrote:
Fri Nov 10, 2023 11:19 pm
I think GD Library does not work. So in the file \admin\model\tool\image.php, at line 31:
Above this line : if ($width_orig != $width || $height_orig != $height) {
Add a new line code as below:
copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

Enjoy it.
Hoang D.
@minhhoangduc from freelancer.com
It was a good solution. My problem is that uploaded images are not converted to the correct size, for example in the search box or where small images we use. The images are used from the cache folder, the image title would be correct (https://elstor.no/image/cache/catalog/DEL120-60x60.jpg) but the original size remains. we using Opencart 3.0.3.2, Journal V3 theme, PHP8.0
Have you any ideas to solve this problem?
Thank you!
That's what that modification does. It will just copy the image if the resize doesn't work. OpenCart 3.0.3.2 in not fully compatible with PHP 8. One of the fixes added in later versions was a PHP 8 compatibility fix for image resizing.

https://github.com/opencart/opencart/co ... 9abe8229ce
I think this solution is working, thank you for the help!

Re: Images are not uploading for cache folder.

Posted: Mon Jan 29, 2024 7:46 pm
by paulfeakins
Elstor wrote:
Sun Jan 28, 2024 2:01 am
I think this solution is working, thank you for the help!
So please now add [SOLVED] to the start of this topic title.

Re: Images are not uploading for cache folder.

Posted: Mon Jan 29, 2024 10:11 pm
by Cue4cheap
paulfeakins wrote:
Mon Jan 29, 2024 7:46 pm
Elstor wrote:
Sun Jan 28, 2024 2:01 am
I think this solution is working, thank you for the help!
So please now add [SOLVED] to the start of this topic title.
Elstor isn't the topic starter.
Mike

Re: Images are not uploading for cache folder.

Posted: Tue Jan 30, 2024 11:55 pm
by paulfeakins
Cue4cheap wrote:
Mon Jan 29, 2024 10:11 pm
paulfeakins wrote:
Mon Jan 29, 2024 7:46 pm
Elstor wrote:
Sun Jan 28, 2024 2:01 am
I think this solution is working, thank you for the help!
So please now add [SOLVED] to the start of this topic title.
Elstor isn't the topic starter.
Mike
Indeed but if this does solve the issue then the OP should add [SOLVED].

Re: Images are not uploading for cache folder.

Posted: Sat Apr 06, 2024 2:57 am
by TexasGreg
emprisestar wrote:
Fri Nov 10, 2023 11:19 pm
I think GD Library does not work. So in the file \admin\model\tool\image.php, at line 31:
Above this line : if ($width_orig != $width || $height_orig != $height) {
Add a new line code as below:
copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

Enjoy it.
Hoang D.
@minhhoangduc from freelancer.com
This solved my problem. Thanks!

Re: Images are not uploading for cache folder.

Posted: Mon Apr 08, 2024 6:53 pm
by paulfeakins
TexasGreg wrote:
Sat Apr 06, 2024 2:57 am
This solved my problem. Thanks!
Great, I've added [SOLVED] seeing as the OP hasn't returned.