Image selection modal freezes with large number of product images

Phoca Cart - complex e-commerce extension
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 88
Joined: 14 Nov 2022, 12:04

Image selection modal freezes with large number of product images

Post by keep2000 »

Hello everyone,

I’ve run into a bit of a problem when uploading product images.
Currently, when I click to add an image, a modal opens showing the entire image storage folder, and at the bottom I can upload a new image and then pick it from the list.

That works fine in general, but things get really slow when there are many products.
I’m importing a store from another system with over 20,000 products and about 80,000 images in total.
When I click the “select image” button, the modal completely freezes the browser while trying to load everything.

I wrote a small script that reorganizes the image folder into subfolders per manufacturer — that helps a bit — but it’s still slow, since some manufacturers have thousands of images.
Also, when I upload a new image, I still have to scroll through the long list to find it.

Would there be any solution or alternative approach for handling huge image libraries like this?
For example, in my case it would be perfectly fine to just have a simple upload button directly in the product edit form, without loading the entire file list in a modal.

I’d really appreciate any tips or ideas! 🙂
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49049
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Image selection modal freezes with large number of product images

Post by Jan »

Hi, when the modal is opened, it displays the list of folders and images on the server, so there is no way to somehow influence the performance, except setting the images into folders like you did. When this does not help:

- then there should be more sophisticated folder structure including folders and subfolders
- or the displaying of folders and files should be disabled by modification, but then there is no way to select the image from this list.

It is really hard to give some clue advice here, because the file manager just displays the files located on the server :idea: So the only way is to do other alternative feature which e.g. skip to display the images on the server :idea:

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 88
Joined: 14 Nov 2022, 12:04

Re: Image selection modal freezes with large number of product images

Post by keep2000 »

or the displaying of folders and files should be disabled by modification, but then there is no way to select the image from this list.
In my case, the whole “select image” feature could actually be turned off.
All I’d need is a simple preview, an input field showing the path value, and — if no file is uploaded yet — a browse button inside the form (not in the modal).

That way:
  • if there’s already an image and I know the path, I can just type/paste it in;
  • if there’s already an image and I don’t need it anymore, I can delete it;
  • if I want to upload a new one, I just browse for it without the modal, save the product, and it gets uploaded and linked automatically.
So basically, instead of the “Select image” button, an inline file input would work perfectly for me
Post Reply