External images not showing

Geskrap
Van Onbekend

I successfully imported my CSV spreadsheet into LiteCart.

Everything is in order except the external images are not showing. The URLs to the images on the CSV file are correct, if I try one of them I can see that they work.

It may be permission issues, missing plugins or something similar on the server host, but I wanted to check the LiteCart side of things. Does this happen with anyone else? Any fixes on this end?

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

This is purely undocumented but I think I implemented a column new_images to import external images. Separated by semicolon.

Try that, I'm on a mobile device right now.

Geskrap
Van Onbekend

Hi @tim, did this "new_images" column replace the old "images" column?

Developer
Van Hungary
Lid sedert Jul. 2017

Add this column to the csv file:
new_images
The exact image will load based on the url. It works for me with versions 2.3.0 and 2.3.1.
You may be importing too many images at once. Try to reduce.

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

Open SSL errors indicate certificate problems. Make sure your servers root certificates are up to date, and that the server you are connecting to has a valid certificate. Stackoverflow.com should have some more reading about this.

Geskrap
Van Onbekend

Ignore my last message, the SSL is fine, I just made a mistake with replacing the images column in the spreadsheet.

I tried @jamie 's way of just adding the "new_images" column to the end of the existing one. I get this error that wasn't happening without the extra column:

[img=800x409]https://files.catbox.moe/bf7vte.jpg[/img]

I'm guessing the extra column did let LiteCart find the images now, but for some reason it can't extract the image's dimensions?

Even my developer is at a loss with this at the moment.

Geskrap
Van Onbekend

I think I have found the problem. After checking with my host, they confirm the embedded images are NOT being blocked on their end. They did however spot this:

[quote]Reviewing the source of https://finecrystalgifts.co.uk/litecart/awards-c-7/jade-clear-smoked-glass-awards-c-426/23cm-x-23cm-x-12mm-jade-glass-pyramid-award-p-1542 (right click, "View Page Source") it appears that the image itself isn't actually being called from it's remote source directly. See below:

<a class="main-image thumbnail" href="https://finecrystalgifts.co.uk/litecart/images/https://customer.crystalgalleries.co.uk/product_images/VGJ37112.jpg" data-toggle="lightbox" data-gallery="product">

That shows that your script is looking for the image in your /litecart/images/ directory.[/quote]

Could there be something wrong with the LiteCart installation (or spreadsheet?) that the /images/ directory is not pulling the URL correctly? I checked the file manager and the index.html file there is completely blank.

I installed this LiteCart from Softalicious (version 2.3.0). I did notice the blank file yesterday and I did try deleting and reinstalling LiteCart afresh, but the file is the same.

How can we make the LiteCart script find the images?

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

Unset the damage from your first attempt when you used the "images" column to set remote images.
This did not come from "new_images" which is your only solution to remote import images via CSV.

Geskrap
Van Onbekend

I've been fresh reinstalling LiteCart and trying again, once by [i]replacing[/i] "images" column with "new_images", and then again by [i]keeping[/i] "images" and adding "new_images" to the end column of the spreadsheet.

In both instances I seem to be back to this error message:

[img=800x409]https://files.catbox.moe/bf7vte.jpg[/img]

That's the image for the first line on the spreadsheet, and so no products are added. It does seem the "new_images" column lets LiteCart find the images, but for some reason it can't extract the image's dimensions?

Geskrap
Van Onbekend

Hi @tim, sorry to ask again but I've been speaking to both my dropshipper who provides the spreadsheet as well as my hosting company and all seems to check out with them. Can you have a resolution to the above post? My developer has been going over it for a week and thinks something may be missing in the LiteCart external image extraction to give the above error.

With regards

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

I think the problem is that you Oct 13 tried to set URLs in the "images" column. Unset them first. After that you can attempt to import them using "new_images".

Geskrap
Van Onbekend

@tim I was completely re-installing LiteCart from fresh, so anything done with the "images" column would have been unset already, but this error is happening with fresh installs too. I even tried on your Demo site and "new_images" still doesn't work.

I'm attaching my spreadsheets in case you see anything wrong with the column headers (test it on your demo site and you will see).

Could there be something with the LiteCart coding that is not pulling the external /new_images/ URLs correctly?

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

I tried importing your CSVs. There is something strange about this server certificate. I suspect it's a very new signer not yet well known in root certificates on servers.

error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in ~/includes/entities/ent_image.inc.php (Line 897)
 ← ~/includes/entities/ent_category.inc.php (Line 217) in type()
 ← ~/admin/catalog.app/csv.inc.php (Line 301) in save_image()
 ← ~/admin/index.php (Line 139) in include()
Request: POST /admin/?app=catalog&doc=csv HTTP/1.1
Host: demo.litecart.net
[font=Verdana, Arial, Helvetica, sans-serif]Referer: https://demo.litecart.net/admin/?app=catalog&doc=csv[/font]

[19-Oct-2021 20:21:48 Europe/Stockholm] Warning: exif_imagetype(): Failed to enable crypto in ~/includes/entities/ent_image.inc.php (Line 897)
 ← ~/includes/entities/ent_category.inc.php (Line 217) in type()
 ← ~/admin/catalog.app/csv.inc.php (Line 301) in save_image()
 ← ~/admin/index.php (Line 139) in include()
Request: POST /admin/?app=catalog&doc=csv HTTP/1.1
Host: demo.litecart.net
[font=Verdana, Arial, Helvetica, sans-serif]Referer: https://demo.litecart.net/admin/?app=catalog&doc=csv[/font]

I can reproduce it with the CLI command:
php -r "file_get_contents('https://customer.crystalgalleries.co.uk/product_images/A50.jpg');"

I have contacted the server crew to see if this is a problem with root certificates.

Geskrap
Van Onbekend

Thank you Tim that's useful, I'll let them know immediately.

Geskrap
Van Onbekend

Hi @tim, we have made some progress. They fixed the certificate and the embedded product images are showing now.

The category images however, still do not show. The column header in the spreadsheet I attached earlier was "new_images" again.

I noticed the template column header was "image" for the category spreadsheet as opposed to "images" for the products spreadsheet. So I tried "new_image" for categories but that just gave an error.

Can you confirm the correct column header for externally embedded [i]category[/i] images?

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

I can confirm your file looks right and I have an issue too with remote category images. Remote support seem to have been implemented only for product images.
I am working on some improvements and will get back to you shortly.

Geskrap
Van Onbekend

That's great thanks Tim.

Geskrap
Van Onbekend

No change I'm afraid. Is it different for you? I tried it on a fresh install and replaced the code first then imported the CSV file but the images still don't show for categories.

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

Do you know if you have Imagick enabled?

Geskrap
Van Onbekend

Ah yes it does work for me after all, thank you. Maybe I just mis-pasted the new code last time.

I'll contact them about the 404 but I think all is fixed on your side. I'll let you know if there is anything more but thanks again for your help with this and for your attention in this matter.

Will the new code be automatically included in the updates, I assume?

tim
Founder
Van Sweden
Lid sedert Mei 2013
tim

Oh good news.
Yes, the new code is committed for 2.3.2

Hierdie draad is gesluit weens lang onaktiwiteit. Om dit te plaas is nie moontlik nie.
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.