开发者

How can I resize images dynamically so they don't look stretched on a page?

I have a website I am building for myself that I want to display the same image, but throughout the site in different sizes. So for example on the Portfolio page I want the image to be very large, but then have same image 开发者_如何学Pythonin thumbnail version on same page, and then on the landing page I want same image to be slightly larger.

What is the best and smartest way to go about this? It would be much easier for me to just make one image, upload to server, and then change the size however I see fit throughout the site so I don't have to upload multiple sizes of the same image. The goal is to scale/resize these so they don't look stretched.


The imageresizing.net library is designed to do exactly this. It installs on any Windows IIS server, and lets you add a querystring after any image URL to resize it.

Ex. image.jpg?width=100 would dynamically resize (and cache to disk, if enabled) the image.

The library has a long history of running high-volume websites such as social networks & photo album services, has a large community, and 39 plugins.

[DISCLAIMER: I'm the author].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜