Using CSS or width/height attributes, an img element can be resized within the browser.
Is using this (extensively) a good strategy, what are the drawbacks?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The main drawback is quality: The browsers’ resizing algorithms are optimized for speed, not quality, with often crappy-looking results.
This blog post makes a good example. While I don’t entirely agree with its title, it has often merit:
There are proprietary CSS filters for influencing the resize method and quality in both IE and Firefox IIRC, but they do not work in all browsers.
The second drawback is client-side performance: you are delegating a costly operation to the client. If the client’s graphics performance is low (say, on a Netbook or an older machine) resizing the image can slow down the whole site.
Another drawback that comes to mind is bandwidth usage: if you deliver a large image is massively shrink it on browser side, you would be transmitting more data than necessary.