Jump to content

[SOLVED] How to manage image field with hundreds of images?


charger
 Share

Recommended Posts

I have a single page with an image field that hold ~600 images. Now apart from it being not very handy to handle, it also takes A LOT of time to load (had to increase PHP timeout to 120s) and it only displays roughly a third of the images in the backend (although I can see all 600 image files in the corresponding assets/files/ folder). There are also no errors in the console.

I read in another forum post a comment from Ryan that image fields don’t scale infinitely, but no explanation to why that happens. Does anyone have experiences with such an amount of images or alternative solutions to the problem? Just to be clear: This is not about rendering the images on the frontend, but about adding them to an image field.

I’m on localhost with MAMP and PHP performance settings bumped. I’m using PW 3.0.200 and PHP 7.3.3.

  • Like 1
Link to comment
Share on other sites

2 hours ago, charger said:

or alternative solutions to the problem?

You'd need to tell us the use case before. Why do you (need to?) upload 100s of images to one single image field??

Link to comment
Share on other sites

Almost exactly 6 years ago Ryan released pagination support for ProFields Table and was thinking about implementing this for more Fieldtypes such as Images: https://processwire.com/blog/posts/fieldtype-pagination/

Unfortunately this hasn’t happened yet, so maybe commission a website from Ryan that involves 600 images per page and he'll prioritise the feature 😉

The first thing I would do to remedy the immediate problem would be to move the images to a separate tab in the page editor. That should keep the loading times down when you just want to change some other stuff. Otherwise, I guess you’ll have to build a custom Inputfield (perhaps without thumbnails) or structure your site differently. Here is a longish thread about turning off the Image field's auto-thumbnails, maybe it has some pointers relevant to your endeavour: https://processwire.com/talk/topic/21112-do-not-create-default-image-variation-on-image-upload/

You could also try using a Files field instead. I imagine the page editor performance will be better and it won’t auto-generate thumbnails. Of course, you’ll have a harder time scaling and using the images in the front-end. Check this thread for more info https://processwire.com/talk/topic/26113-resize-image-manually/

 

 

  • Like 2
Link to comment
Share on other sites

17 hours ago, Jan Romero said:

You could also try using a Files field instead. I imagine the page editor performance will be better and it won’t auto-generate thumbnails. Of course, you’ll have a harder time scaling and using the images in the front-end. Check this thread for more info https://processwire.com/talk/topic/26113-resize-image-manually/

 

That did the trick! The Files field is indeed a lot more performant than the Images field. On top of that, I noticed it doesn’t seem to alter the original image file during upload. When I was using the Images field, it seemed to corrupt the EXIF/IPTC data of the original image file. I could only read that information of about 50% images after the upload. Using the Files field, I can read that data from all the images.

Link to comment
Share on other sites

  • charger changed the title to [SOLVED] How to manage image field with hundreds of images?

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...