Jump to content

High power image regeneration


Recommended Posts

Thanks! I am using something similar, Ajax, to regenerate images. But these modules are all set for low resource use. A trick I use to overcome this limitation is to open multiple browsers and set each to work on a different image size simultaneously. That helps a lot, but I sure wish I could find something made for power users and not shared hosting speed.

  • Like 1
Link to comment
Share on other sites

Hi.

A lot of programmers forget that some php and GD functions are slow. For example, when regenerating images, it generates a new white background every time and for every dimension. Another problem is in the pictures. The image has a jpg extension, but it is a png image. So, for each image, its image type must be determined. For my customer, I programmed a module that, when saving a product image, writes its correct image type into the ps_image table. Furthermore, when the regeneration is started, the module creates all white backgrounds for all image types and starts ajax several times, for each size separately. 10,000 images are done in no time.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 9/27/2023 at 2:52 PM, ps8moduly.cz said:

Hi.

Sorry, not for sale. Built for specific customer requirements, it includes many other features than just image regenerate. But I was already thinking about modifying it for sale.

Would be great to have it. Regenerate for like 100k+ is real pain :)

  • Like 1
Link to comment
Share on other sites

We have included this functionality in our Prestashop suite QuickUpdate - eg you are able to regenerate images for any number of products down to the product level. Additionally if you have a large number of products you will have a very speedy regeneration and not get a time out because the app does batch parallel processing of the products you want to regenerate / up to 5 parallel requests at once. This is how it looks:

Screenshot2023-11-02234803.thumb.png.bf991d633b5099369b2c675ddca4e289.png

Link to comment
Share on other sites

image.thumb.png.14bf4cddae00417dc1950a20faa3fc7b.png

 

If your server performance is average, then please generate images one by one like this:
1.Select an image
2.Select a format
3.Erase previous images:No
In this way, you can prevent the server from getting stuck and avoid the time-consuming wait of generating a large number of images at once.
The only cost is that you need to do it a few more times. But this can operate accurately and maintain the stability of the PrestaShop core.

Link to comment
Share on other sites

@ZHSoft thank you for your post. It is good advice for how to use the native PS image generator. The problem in this thread isn't server performance is average. The problem is generating 1 million images on a dedicated server in a reasonable time. If you have a lot of images and you have dedicated server resources, there isn't a power user method to generate images. I see that PS 8.1.2 is using Node.js sharp to generate images. It is certainly possible to use that in a more powerful way.

Link to comment
Share on other sites

 @Bill Dalton The most problematic issue when you regenerate a large number of images as you say you have is not having a sense of control and completion of the task (because of errors / timeouts etc.). In case you have a consistent method of regenerating those images without the "fear" of timeout of failure - your issue should not longer be a problem - my point being that the core of your problem (and others) is consistency and not speed (eg. you could leave a regenerating task to run for 1,2,3 days as long as you know the process will complete and do the job consistently for you).

Edited by QuickUpdate.net (see edit history)
  • Like 1
Link to comment
Share on other sites

@Bill Dalton

First set Erase previous images: Yes, which will delete the old thumbnail images that are already there.
Then set Erase previous images: No. Don’t worry if the timeout occurs. Continue to set Erase previous images: No. Keep setting Erase previous images: No in this way until all prompts are generated.
This is the mechanism of PrestaShop. It will automatically detect which pictures have not been successfully generated. Therefore, as long as you maintain the above operations, they will be successfully generated in the end.

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...