Tuesday, September 7th, 2010
If you’re working with mobile browsers tinySrc will dynamically scale your images down to the right size on the server side:
To use, you simply prefix the URL to your image with a pointer to tinysrc:
- <img src='http://i.tinysrc.mobi/http://mysite.com/myimage.png'
- alt='My image'
tinySrc will then do the magic for you:
Unless you tell it otherwise, tinySrc will resize the image to fit the screen of the mobile handset visiting your site. For example, if an iPhone visits the site, the image will be constrained to its screen size of 320px x 480px.
In this particular case, the image is of landscape orientation, and width is the constraining dimension. Aspect ratios are always preserved by tinySrc, so our 640px by 400px image will emerge resized for an iPhone as 320px by 200px.