Given the frequency of this of this super common wanted behavior in websites, why is it that we have GPS tracking and webcam stuff like webrtc but we still can't scale a common jpg? Google, Mozilla? Anyone?
https://www.youtube.com/watch?v=EvKTOHVGNbg
Another point is that holding onto the unmodified images server-side (and merely serving a cached, resized, optimized version on the fly) can be beneficial for future use cases.
Check out, e.g., Thumbor [2] if you're curious to see more of the complexities involved. I have self-hosted it for a company before, and it worked well.
https://hacks.mozilla.org/2011/01/how-to-develop-a-html5-ima...