On a site that has many different image sizes each time an image is uploaded all the different thumbnail sizes are created causing a fair bit of bloat. What would be the best way of optimising this process?
With a custom post type of ‘product’, where the different product type images have slightly different aspect orientations, should (the plugin) register all the possible image sizes? e.g.
add_image_size('small-A', 45, 67, array('center', 'center')); add_image_size('small-B', 35, 49, array('center', 'center')); add_image_size('small-C', 42, 65, array('center', 'center')); add_image_size('small-D', 50, 50, array('center', 'center'));...
But assuming when the plugin creates a product A, and the front end will never use the other formats for that size; should one only register the necessary sizes for ‘A’ format before running
media_handle_upload(), would that affect the front end?
remove_image_size() on all the unnecessary image sizes just before
Or, is there a different / best-practice approach?
Obviously, impact on performance, scalability and especially impact on storage are of some concern.
Thanks in advance.
(PS. one could conceivably just generate a standard image size and place the appropriately sized image inside that with PHP, but that seems a bit like cheating and possibly creating scaling problems down the road)