Support » Plugin: Optimize Images Resizing » Performance improvement on initial upload (pull request!)

  • Resolved Ben Cole

    (@bcole808)



    Hello! I am a fellow plugin developer and I found your plugin and love that it adjusts image resizing behavior in exactly the way I want.

    I read the source code of the plugin and saw that upon initial image upload, all image sizes were being generated and then deleted by this plugin. This would cause extra CPU load on the server because of the extra step to generate then delete all of the image sizes on upload.

    I found a filter called intermediate_image_sizes_advanced which allows the filtering of image sizes that are created on initial upload. I then tweaked this plugin by using that filter to simply prevent image creation upon upload. With this new tweak, only the default image sizes are created upon image upload, and then the other sizes are generated on demand.

    Below is a link to a diff showing exactly what I wrote to do this. If you have a github page for this plugin, I would love to submit a pull request! Otherwise please feel free to use this code in the plugin if you think it would be beneficial to others.

    https://gist.github.com/bcole808/fedfa2081578ec6e3a05/revisions?diff=split

    Thanks for the great plugin!

    https://wordpress.org/plugins/optimize-images-resizing/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Performance improvement on initial upload (pull request!)’ is closed to new replies.