views:

274

answers:

4

I have an image that is around 1200 x 400 (if I remember right), and is about 50kb in size. I use the image in a header for a website, but I constrict the height of the image to 100px in order to make it fit my header.

<asp:Image ID="imgLogo" runat="server" ImageUrl="~/Images/AFact.jpg" Height="100px" />

Is this a bad practice? Does it mean that the image is being downloaded in full to the client, and then the client's browser has to waste cpu to resize it? Would I be better off to scale the image down to the height that I want it at by using Photoshop?

+10  A: 

Is this a bad practice? Does it mean that the image is being downloaded in full to the client, and then the client's browser has to waste cpu to resize it? Would I be better off to scale the image down to the height that I want it at by using Photoshop?

Yes to all your questions.

womp
+3  A: 

Yes, yes, yes!

Not only you download a big file and only display a small one. The browser is really lousy in scaling images. So it will look ugly, too :)

Norbert Hartl
Excellent point to mention. +1
zombat
A: 

Same as the others yes to your questions. You can use a tool like imagemagick to resize your images in a batch file.

lothar
A: 

Big YES

Amr ElGarhy