Post by frankpmjr » Sat Jun 16, 2018 10:27 pm

Hello,
I am migrating an OC site from one host to the next and upgrading to 3.0 at the same time. All is going well but I FTPed all my images from old host to new host and when I uploaded my products a bunch of the pics came up blank. After a little poking around I found that a lot (more than half) of the pics have white spaces injected into them but only in the admin (if I add a picture to a product manually I see the whitespace) but if I look in the actual picture folder (using FTP or Cpanel) the name is fine. So I can't fix it reuploading or renaming the file in the Cpanel or via FTP. How do I get around this other than manually inserting every picture (about 1000 that didn't link when I did the uploads)? Thanks

Newbie

Posts

Joined
Sun Jan 21, 2018 2:03 am

Post by sw!tch » Sun Jun 17, 2018 1:54 am

Only thing I can think is your encoding is different between hosts and handling character set differently, either mySQL or when you uploaded them via FTP. You can try using gzip to pack all the images from your old host and then unzip them on the new host. Or when you did your database import the encoding is different.

Too little information you provided to be any help.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by IP_CAM » Sun Jun 17, 2018 2:10 am

Well, you could download your images by FTP, to get 'em all, and then,
use a File Manager, or later an SEO Tool, to have 'em renamed. But be
aware, that every single image needs to be re-linked to the product again.
You should have been doing this before, it would have saved some time,
to do such according http-standards, valid, since the internet started to exist. :-\
Good Luck
Ernie
---
Mass Image Rename
https://www.opencart.com/index.php?rout ... n_id=14343
---
Product Image Bulk Rename - SEO Image Name Manager
https://www.opencart.com/index.php?rout ... n_id=19737
---
File Manager
Normalizer : UTF-8 Normalizer of file-name and file-path etc.
Sanitizer : Sanitizer of file-name and file-path etc.
https://www.opencart.com/index.php?rout ... n_id=32460
---

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 ArtGallery » Mon Mar 25, 2019 6:48 am

I am experiencing the same issue. Images uploaded through the Admin for an individual product will sometimes display blank spaces between some characters in the file name. This doesn't happen every time, but once it occurs, it stays that way permanently.
Example:
Original File Name product-name-2x55.jpg is showing as product-name-2x5 5.jpg -- Note the blank space between the fives. This is only how it is shown in the Image Manager. The actual file names are not changed in the images folder. When I first noticed it I thought I had made an error in naming the original file, which was not the case. Everything seems to be displaying fine on the front end.

New member

Posts

Joined
Sat Apr 21, 2018 7:54 am

Post by henfeb » Mon May 13, 2019 10:56 pm

I am facing the same from of my filenames in opencart image viewer showing blank spaces. e.g hello.jpg becomes hello.jp g
I tried to delete everything and reupload the images. But somehow the filenames just randomly have spaces. The Catalog/images filenames are normal with no spaces. My website is not showing the images with the problem. I hope someone can help me with this problem. Thank you
Last edited by henfeb on Thu May 16, 2019 10:55 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Apr 04, 2019 7:30 am

Post by henfeb » Thu May 16, 2019 10:53 am

Image

I hope somebody can help me.
Why there are random spaces for the filenames when in Opencart?
But when I look at the root directory of server"images>catalog" folder the file names doesn't have those spaces?

Newbie

Posts

Joined
Thu Apr 04, 2019 7:30 am

Post by letxobnav » Sat May 18, 2019 3:36 pm

probably to do with artificial wrapping of file/directory names to make the file-manager grid look nice with long file/directory names.

it first splits the names at 14 characters:

Code: Select all

$name = str_split(basename($image), 14);
and then glues them back again with a space added.

Code: Select all

'name'  => implode(' ', $name),

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Jaesin » Thu Feb 20, 2020 6:19 am

Wow... the search actually worked and I found this thread..
Thanks for the answer, kind of silly thing to do really.

New member

Posts

Joined
Wed Aug 23, 2017 11:31 pm

Post by info@wescomedia.com » Sat Sep 12, 2020 6:21 am

letxobnav wrote:
Sat May 18, 2019 3:36 pm
probably to do with artificial wrapping of file/directory names to make the file-manager grid look nice with long file/directory names.

it first splits the names at 14 characters:

Code: Select all

$name = str_split(basename($image), 14);
and then glues them back again with a space added.

Code: Select all

'name'  => implode(' ', $name),

That was a nice catch to fix the Image Manager "white space" issue.
store/controller/common/filemanger.php

Code: Select all

'name'  => implode(' ', $name),
change to

Code: Select all

'name'  => implode('', $name),
My images still won't show up in admin or customer side.

Midwest United States
Photoshop - InDesign - Illustrator
OC 3.03
Linux - CPanel - PHP 5.4.45



Posts

Joined
Thu May 07, 2020 1:58 pm

Post by letxobnav » Sat Sep 12, 2020 6:58 am

that code is for how the name is displayed, not for how your images are found or not.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Sat Sep 12, 2020 9:43 pm

Already fixed on the master branch.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by info@wescomedia.com » Sun Sep 13, 2020 1:21 am

yep... it fixed the white space issue.
Still looking for a reason the images won't show up in Image Manager or browser.
The store logo shows up but not product images.

Code: Select all

define('DIR_IMAGE', '/home/mysite/public_html/store/image/');
I've tried to change it as a test, but the store logo won't show. So I feel that this is the correct path.
Wondering if it's a PHP version issue. I'm on PHP 5.4.45

Midwest United States
Photoshop - InDesign - Illustrator
OC 3.03
Linux - CPanel - PHP 5.4.45



Posts

Joined
Thu May 07, 2020 1:58 pm

Post by IP_CAM » Sun Sep 13, 2020 2:52 am

??? PHP 5.4.45
You should move up fast, that time is really over ...

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 info@wescomedia.com » Sun Sep 13, 2020 12:02 pm

IP_CAM wrote:
Sun Sep 13, 2020 2:52 am
??? PHP 5.4.45
You should move up fast, that time is really over ...
I know. It's a leased/shared server. They offer to upgrade but I'm worried sites will have issues. I host dozens, so It's scary.

Midwest United States
Photoshop - InDesign - Illustrator
OC 3.03
Linux - CPanel - PHP 5.4.45



Posts

Joined
Thu May 07, 2020 1:58 pm

Post by sw!tch » Sun Sep 13, 2020 6:01 pm

info@wescomedia.com wrote:
Sun Sep 13, 2020 12:02 pm
I know. It's a leased/shared server. They offer to upgrade but I'm worried sites will have issues. I host dozens, so It's scary.
Scary is running a 5 year old EOL PHP version. You should ask your host if they have multi-php support, you could then slowly migrate your sites to newer PHP versions instead of an all at once upgrade.

Surprised hosts still even offer 5.4 as an option. In any case, should really get that updated or hire a developer to work with you, PHP 7 brought a lot of speed enhancements to PHP.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by IP_CAM » Sun Sep 13, 2020 9:26 pm

My Hoster offers a function, to be placed in line 1 of the
(ROOT+) SHOP .htaccess file of each OC Site I have, to
individually select the PHP Version used. It looks like this:

Code: Select all

AddHandler application/x-httpd-php72 .php
#@__HCP_END__@# 

Code: Select all

AddHandler application/x-httpd-php73 .php
#@__HCP_END__@# 

Code: Select all

AddHandler application/x-httpd-php74 .php
#@__HCP_END__@# 
And if you have some older OC Versions on your Site, they usually only require
another system/library/encryption.php File, to work flawless with PHP v.7.4.9
so far, depending on, what's available on PHP Versions from the Hoster.
At least, if used with default-theme-like installs, but I don't know about JOURNAL ... ::)
That's the one I use for my v.1.5.6.5_rc Versions:

Code: Select all

<?php
final class Encryption {
	private $key;
	private $iv;
	
	public function __construct($key) {
		$this->key = $key;
	}
	
	public function encrypt($value) {
		return strtr(base64_encode(openssl_encrypt($value, 'aes-128-cbc', hash('sha256', $this->key, true))), '+/=', '-_,');
	}
	
	public function decrypt($value) {
		return trim(openssl_decrypt(base64_decode(strtr($value, '-_,', '+/=')), 'aes-128-cbc', hash('sha256', $this->key, true)));
	}
}
?>
So, better ask your Hoster, if something similar exists, to individually adjust your Sites.
Ernie

Some (OC v.1.5.6.x / 2.x) encryption.php files can be found here, it's the same for those Versions:
https://www.opencart.com/index.php?rout ... earch=php7

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 letxobnav » Mon Sep 14, 2020 12:09 am

so we go from image name white space to not finding images to php versions to encryption back to php version switching, what could be next?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by by mona » Mon Sep 14, 2020 12:55 am

Christmas !


I believe this second issue is SOLVED in a new thread
viewtopic.php?f=170&t=219957

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by IP_CAM » Mon Sep 14, 2020 3:39 am

so we go from image name white space to not finding images to php versions to encryption back to php version switching, what could be next?
Well, it's called 'combining knowledge', a Topic, where one can also find other Wisdom and
Download Links, to find solutions, or possibly solve problems, before they even exist.... ;) :D
This Place her is not so transparent, and what's not linked in 'main' Sections, is quite
hardly to be found, especially for Newbies, partly not even aware of what they use ...
In addition the the known fact, that the Forum Search Engine is just a piece of crab ... :-\
But most important is, to have it 'googled', it saves a lot of bread, to still stay atop ... :laugh:
And that's possible, if one takes care, to 'please' those fellows too, with, what they're looking for.
It's called 'CONTENT'
Ernie ;)

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
Who is online

Users browsing this forum: nonnedelectari, Semrush [Bot] and 404 guests