Post by bertjebel » Sat Nov 03, 2012 11:01 pm

Hello,

I have a rare problem. In my shop all the images for the backend show, but in the frontend images with whitespaces '+' (special charachters) won't show unless they are renamed.

I searched the forum but can't find what to do or change. Has someone a suggestion on what to change or add?

Hope someone has an idea.

Regards

My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone


User avatar
Active Member

Posts

Joined
Tue Jun 21, 2011 11:17 am


Post by Avvici » Sun Nov 04, 2012 1:03 am

You shouldn't be naming your images with special characters or white spaces, ever. Use Underscores if you must have a space. However, it still should show the image on the front end just fine. A test example image title would be no image 2+.jpg Please give us an example of what your image titles are so we can see. Thanks.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by bertjebel » Sun Nov 04, 2012 3:00 am

The image names are like:
TVS-KN-CC110A WITH SIZE.JPG
DISPLEX TOUCH_ART+BL.JPG
50279887009_ART+BOX.JPG

I rahther have them named otherwise but this is a CSV of 25000 products wich is automated. Very hard to rename the everyday updates. So if there is a way to rewrite spaces and special characters I would be happy.

My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone


User avatar
Active Member

Posts

Joined
Tue Jun 21, 2011 11:17 am


Post by rph » Sun Nov 04, 2012 3:23 am

That's really the perfect example of how not to name images. Always use lowercase and only use letters a-z, numbers 0-9, underscore, and dash.

If this is already loaded into your database you can bulk update the names with the following SQL queries in phpmyadmin:

Code: Select all

UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by Avvici » Sun Nov 04, 2012 4:59 am

rph wrote:That's really the perfect example of how not to name images. Always use lowercase and only use letters a-z, numbers 0-9, underscore, and dash.

If this is already loaded into your database you can bulk update the names with the following SQL queries in phpmyadmin:

Code: Select all

UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');

And after that you might as well do:

Code: Select all

UPDATE product SET image = REPLACE(image, '+', '_');
UPDATE product_image SET image = REPLACE(image, '+', '_'); 

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by bertjebel » Sun Nov 04, 2012 5:27 am

thanks for the reply and solution.

For a once replacement of image names and urls that's an ok solution. My wholeseller is delivering the csv to me with those special characters. That's my biggest problem. Every day when the update is done there are new products written with those characters. The only, not so nice, solution i can think of is to write a file with update statements for the db and run that cronjob. I rather have an opencart solution that rewrites when or before data is imported. That way i don't have to run a script every day, but it's a one step solution.

My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone


User avatar
Active Member

Posts

Joined
Tue Jun 21, 2011 11:17 am


Post by Avvici » Sun Nov 04, 2012 6:41 am

bertjebel wrote:thanks for the reply and solution.

For a once replacement of image names and urls that's an ok solution. My wholeseller is delivering the csv to me with those special characters. That's my biggest problem. Every day when the update is done there are new products written with those characters. The only, not so nice, solution i can think of is to write a file with update statements for the db and run that cronjob. I rather have an opencart solution that rewrites when or before data is imported. That way i don't have to run a script every day, but it's a one step solution.
First, tell your whole sellers to stop formatting the images that way.
Second, feel free to hire someone to write some code that will tweak the image title strings upon import with your current script. Until then just use the above query to update everything after csv import.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by rph » Sun Nov 04, 2012 7:34 am

You'll need to rename your images too. I'd recommend Bulk Rename Utility. It's very powerful and free.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by Avvici » Sun Nov 04, 2012 7:55 am

Too bad there isn't a mac version :)

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by rph » Sun Nov 04, 2012 8:29 am

Use Boot Camp?

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by robster » Thu Nov 08, 2012 3:18 am

I have a similar issue - but slightly different!

I am using an extension (pdf catalog) and it seems to be fine with white spaces in image names, however my images are in image subdirectories with white spaces - now it doesn't like that!

So if, for example I have images stored in: /image/data/new directory (note the white space between new and directory), assuming that I do what is suggested with the images above, what would that sql command be please to add _ between each word in subdirectory name?

Many thanks if someone can assist with this.

Robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by bertjebel » Thu Nov 08, 2012 3:36 am

Hello Robster,

removing the whitespace solved my image errors. So that should solve your problem also.

I think you should rename the directory wit a _ (underscore) en than also use the same sql commando

UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');

good luck

My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone


User avatar
Active Member

Posts

Joined
Tue Jun 21, 2011 11:17 am


Post by BrandonBerner » Sat May 14, 2016 4:27 am

I also have a similar problem.

I have lots of pictures with spaces and - in them

This prevents Facebook from displaying images with your links in a facebook post.

I would like to rename all images, but dont know what Database to edit in MyPHPAdmin

What Database do i select to enter the following code

Code: Select all

UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');
Thanks

Active Member

Posts

Joined
Sat Dec 15, 2012 4:49 am
Who is online

Users browsing this forum: Amazon [Bot] and 19 guests