0

I was wondering is there any way to automatically resize images to match the dimensions set by the user. What I mean is:

  1. User creates a post and he puts an image with id="my_img" and src /my_path/my_img.jpg. He adds css #my_img {width: 310px;}
  2. The plugin matches these and it generates copy of my_img.jpg with dimensions set by CSS and name ex my_img_310px.jpg.
  3. The plugin changes img src to /my_path/my_img_310px.jpg
  4. Every image in every resolution is transmitted in perfect dimensions and page speed is awesome.

I couldn't find any plugins with such a functionality and everywhere I look I read images shall be uploaded in matching dimensions.

Do you know any way of achieving this or why is it impossible?

  • Likely possible, but is it a good workflow? Why should user micromanage dimensions? How will it resist dimensions set to least fitting into design possible? – Rarst Dec 13 '16 at 19:36
  • there are other reasons as well, but if for every resize of the window you will ask the server to generate a new image, the server will die quickly. – Mark Kaplun Dec 13 '16 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.