Jump to content

Desperatly need help with image importing in 1.6.1.1


Recommended Posts

Hi,

I am developing a shop to sell my pictures and have created a system in visual FoxPro to manage and catalogue the pictures, this then exports to CSV files which I am then importing in to prestashop using the import CSV and also directly using PHPadmin for ones that CSV import does not support (accessories).

All works well, the catagories and products import fine and we manually import the accessories file using PHP admin and that all work fine, the problem I cant solve is the old importing the images problem, just gives 'error loading image'.

I have read just about every post on the forum and so far :

1. Images are tiny only 200 x 170 odd pixels, 10k maybe average in size
2. you can load them manually if the back office and they work fine
3. I created a directory called pics in the shop folder and made sure it had 777 permissions
4. uploaded the pictures to the pics folder
5. You can access them pictures in a browser using the link directly
5. I am only trying to import 5 at the moment and I have tried to use the same picture for each one just for testing but for each line in the csv I have tried a different approach to see if any worked, I have go :

http://futurescopecomputers.co.uk/262/shop/pics/IMG0459.JPG
futurescopecomputers.co.uk/262/shop/pics/IMG0459.JPG
http://www.futurescopecomputers.co.uk/262/shop/pics/IMG0459.JPG
../pics/IMG0459.JPG
../../pics/IMG0459.JPG

I cant find much actual information on the importing of images so have assumed the above.

I assume the name does not matter as long as I put it in the image field in the CSV ?

Trying the above, everyone fails with the error.

I am tearing my hair out, I spent a week trying to find the solution and got nowhere, gave it a rest and did the other bits and now this is all that remains but being a picture site its pretty important !

Server is a dedicated server from 1&1 using Plesk and Centos, PHP 5.3, I have tried safe mode on PHP on and off, increased the memory to 256m, increased the timeout to 10 minutes (the import only take a short time).

Any help would be VERY much appreciated as I am fast running out of ideas and am sure its something really stupid that I am missing.

Thanks

Mark

Link to comment
Share on other sites

Save your hair, stop tearing it out and losing so much time by hiring a professional hehe ;)

 

The store will take images when adding them to the CSV with their URL. For products already existing, the ID should be matching. That is all. I have done it in the past and it works. Your error might be in the CSV you try to import, but without looking over what you are doing or using, it's difficult to diagnose in more detail. 

 

All other things you have mentioned are completely unrelated and you should really not use safemode with anything today. 

 

Unrelated, but important: You should upgrade from the very old, in the meanwhile unsupported PHP 5.3 to a newer version. 1&1 does support all newer versions!

Link to comment
Share on other sites

Thanks Innovacy,

I am a professional though, well programmer and web designer, done a few shops with Prestashop but this is my own project and taken it a step further this time in developing the full photo catalogue system in FoxPro and the exporting, next step is to have it directly edit the databases but the logical first step was to get the files to import so I know everything worked.

All the other things I mentioned were just things I had seen in other posts so I thought I would mention them so people know what I have already tried or else I suspected I would just get a load of posts saying to try these things or read the other topics on this problem, all of which I think I have tried.

So are you saying I can create the products then go back and add in the pictures after ?, if so I am assuming you mean using the CSV import feature ?, do I just need to to have the second file with the ID and picture then ?.

Still have no idea why its not working, the CSV is defiantly correct in its format, I have tried putting the same file data in other fields and going back to see if they are ok in the database after and they look fine. Must say the import routines are a real pain in Prestashop and lack of import for things like accessories which is just a 2 field database seems crazy, might try to create a free module to do that once I have this working.

Still pulling out the hair and looking for the solution or another cart that will do the same job.

Thanks

Link to comment
Share on other sites

I am not sure if this would help you, but did you consider Prestashop images structure? 

All images are saved in 'img' folder.

Carriers are saved in 'c' folder, products in 'p'

When you go to 'img/p/' you will see folders with numbers these numbers are related to products IDs 

 

You should investigate this more. 

Link to comment
Share on other sites

So, I weren't sure if I had a previous import file, a quick check though revealed I have quite some of these where I have imported also images. 

 

I'm adding here for you a very short sample:

 

 

ID,Active (0/1),Name *,"Categories (x,y,z...)",Price tax excluded or Price tax included,Tax rules ID,Wholesale price,On sale (0/1),Discount amount,Discount percent,Discount from (yyyy-mm-dd),Discount to (yyyy-mm-dd),Reference #,Supplier reference #,Supplier,Manufacturer,EAN13,UPC,Ecotax,Width,Height,Depth,Weight,Quantity,Minimal quantity,Visibility,Additional shipping cost,Unity,Unit price ratio,Short description,Description,"Tags (x,y,z...)",Meta title,Meta keywords,Meta description,URL rewritten,Text when in stock,Text when backorder allowed,"Available for order (0 = No, 1 = Yes)",Product available date,Product creation date,"Show price (0 = No, 1 = Yes)","Image URLs (x,y,z...)","Delete existing images (0 = No, 1 = Yes)",Feature(Name:Value:Position),"Available online only (0 = No, 1 = Yes)",Condition,"Customizable (0 = No, 1 = Yes)","Uploadable files (0 = No, 1 = Yes)","Text fields (0 = No, 1 = Yes)",Out of stock,ID / Name of shop,Advanced stock management,Depends On Stock,Warehouse
,0,Frischer Aal küchenfertig,12,,2,,0,,,,,SKU10500100,1004,Müritzfischer,,,,,,,,,,,both,,,,,"<p>Das Top-Produkt zum Räuchern! Einfach nach eigenem Wunsch salzen und im Räucherofen wird unser Aal zu einer einmaligen Delikatesse. Natürlich erhalten Sie nur die beste Qualität.</p><p>Der Aal lässt sich auf verschiedene Arten zubereiten, er ist ein Klassiker der norddeutschen Küche. Jedes Jahr besetzen die Müritzfischer bis zu 150.000 Aale in ihre Gewässer, was eine nachhaltige Bewirtschaftung garantiert.</p><p>Wichtig für ungetrübten Gemuss, den Aal vorher entschleimen. Dazu den Aal rundrum mit grobkörnigen Meersalz einreiben, 2-3 Minuten einwirken lassen und anschließend das Salz mit dem daranhaftenden Schleim gründlich abstreifen.</p>",,Anguilla anguilla,,,,,,0,,,1,,,,1,new,,,,,1,1,,1
,1,Aal geräuchert,"7,13,9,12",,2,,0,,,,,SKU10500101,5068,Müritzfischer,,,,,,,,,,,both,,,,,"<p>Die Ergänzung zu unseren Wildfängen. Ein wesentlichr Vorteil ist die immer gleiche Größe und die ganzjährige Verfügbarkeit. Durch unsere Räuchermsieter wird auch dieser Aal zum perfekten Genusserlebnis.</p><p>Der Aal lässt sich auf verschiedene Arten zubereiten, er ist ein Klassiker der norddeutschen Küche. Jedes Jahr besetzen die Müritzfischer bis zu 150.000 Aale in ihre Gewässer, was eine nachhaltige Bewirtschaftung garantiert.</p><p>Mit einer frischen Scheibe Schwarzbrot eine Gaumenfreude die Sie sich nicht entgehen lassen sollten und die natürlich auf keiner Feier fehlen sollte.</p>",Süsswasser,Anguilla anguilla,,,,,,1,,,1,http://w3.fishbuy.net/pi/mo1018.jpg,,"pp-Herkunftsort:aus Niederlande:4:0,ppx-Herstellungsart:aus Aquakultur:15:0,pp-Produkt Tip 1:schmeckt perfekt zu Weisswein:8:0,pp-Produkt Tip 2:ohne zubereitung sofort genießen:9:0,Lieferzustand:Die Lieferung erfolgt gut gekühlt.:10:0,Verpackungsart:Artikel ist Vakuum verpackt.:11:0,pp-Gewässerart:Süsswasser Spezialität:6:0,pp-Produktzustand:geräuchert nach hause geliefert:7:0,Mindesthaltbarkeit:10 Tage,Temperatur:Bei 2 bis 7°C",1,new,,,,,1,1,,1
,1,Aal in Aspik mit Haut,"5,13,10,12",,2,,0,,,,,SKU10500102,9003,Müritzfischer,,,,,,,,,,,both,,,,,"<p>Aal in Aspik wird immer wieder gern zu Bratkartoffeln  oder einfach auf Brot genossen. Wichtig: unbedingt kühl servieren, dann lässt sich der Aal in Aspik besser stürzen.</p><p>Der Aal lässt sich auf verschiedene Arten zubereiten, er ist ein Klassiker der norddeutschen Küche. Jedes Jahr besetzen die Müritzfischer bis zu 150.000 Aale in ihre Gewässer, was eine nachhaltige Bewirtschaftung garantiert.</p><p>feinster Aal in pikantem Aspik mit Sauce tatare und jungen Kartoffeln - ein Vergnügen.</p>","Süsswasser,Regionale Produkte,Wild Fisch,Regionale Produkte,Wild Fisch",,,,,,,1,,,1,http://w3.fishbuy.net/pi/mo1002.jpg,,"pp-Herkunftsort:aus Deutschland:4:0,ppx-Herstellungsart:aus Müritzfischer Binnenfischerei:15:0,pp-Produkt Tip 1:schmeckt perfekt zu Weisswein:8:0,pp-Produkt Tip 2:ohne zubereitung sofort genießen:9:0,Lieferzustand:Die Lieferung erfolgt gut gekühlt.:10:0,Verpackungsart:Delikatesse im Glas.:11:0,pp-Gewässerart:Süsswasser Spezialität:6:0,pp-Produktzustand:als Marinade nach hause geliefert:7:0,Mindesthaltbarkeit:30 Tage,Temperatur:Bei 7 bis 15°C",1,new,,,,,1,1,,1
Link to comment
Share on other sites

Pff, the forum eat the rest of my post... 

 

Ok, I wrote too, that the exact same data has been working fine in the 1.6 versions. 

 

As you can see, the image is stored somewhere, where Prestashop can download it from and process it from there. In the above example one of these URLs is: http://w3.fishbuy.net/pi/mo1018.jpg

 

Nothing unusual here, as you can see.

 

Oh yes, the column "Delete existing images" should be considered too... just saw that, I had forgotten about. 

Edited by innovacy (see edit history)
Link to comment
Share on other sites

This is a test CSV file I am currently using, all the products import fine as I said, as do the accessories in my accessories file so I am assuming its nothing to do with the CSV actual format.

Not sure I have the delete existing images though, never seen that field in any of the demo files I downloaded from Prestashop, I just created a dbf file with the same structure them create all my data in there then just export it direct form VFP to a csv retaining all the format of the file.

 

 

 

 

 

Link to comment
Share on other sites

Am I being stupid but how do the img/p directories relate to the product ID, my product ID's start at 3000 but the directories are 1,2,3,4,5,6
I added an image manually to take a look what happens, it just created the next directory in the chain i.e I already had 6 so it created 7 and put the pictures in there.

I am guessing it then just adds that dir to the product record and the actual number has nothing to do with the ID directly just the product on that id

al I then removed the picture from the product using prestashop back office and it never removed the directory, does it normally tidy up these ?, if not its gonna be a real problem as I shoot 4-5k pictures per event and after x months I will remove the items from the site and I assumed it would remove the images as well.

Link to comment
Share on other sites

Well I looked at your CSV and only difference I could find was that you don't have double quotes around file name which I do, I edited the file and removed them from the first item just to see if it worked.

That product now does not show an error loading image but their is no image loaded for it so I am guessing maybe it just ignores is and it does maybe need the " around it ?!

 

Link to comment
Share on other sites

Yeah it shows ok in with the double quotes in that th error message has the correct file name displayed, that's the silly thing and we know its correct in that you can get to it from a browser so maybe a saving issue ?

I did not specify delete images in the file but did select the delete all images option on the import CSV screen in Prestashop.

Link to comment
Share on other sites

Well I have had a break through, I tried putting the images in the root of another domain I have and linking to there for the import and it worked !, now the weird bit is that the other domain is on the same server so has 100% the same settings and access and the domain that the shop is on in theory has less permissions on that domain as they are just accessing it as a normal web user.

I suspected maybe it was because they were in the root of the website so I tried the same on the domain the shop is on and moved all the images to there and put that reference in the CSV and it fails ?!

Now I know from other posts I have read that people usually put them in the same domain as the shop so that's not a problem usually.

Its a solution and it works and I have the whole server of my own so its not a problem doing it this way but love to know why it is causing errors on the same domain.

Thanks for everyone who has commented on this, gave me more things to try and do ultimately lead me to this solution in a roundabout way, I was out of things to try so was about to bin Prestashop which would have been a shame as I have other that do work but they look crap visually to Prestashop and would have take loads of work to get them up to the same layout.

Well done it with 3 images now to see if it works with a full event and move on to taking payments.

Thanks again and if anyone has any thoughts on why this is happening would be appreciated.

Link to comment
Share on other sites

  • 6 years later...
On 10/22/2015 at 1:10 PM, Simonas Invertus said:

I am not sure if this would help you, but did you consider Prestashop images structure? 

All images are saved in 'img' folder.

Carriers are saved in 'c' folder, products in 'p'

When you go to 'img/p/' you will see folders with numbers these numbers are related to products IDs 

 

You should investigate this more. 

The folders structure (nowadays at least) represents the image id.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...