|
| 1 | +# Angular WURFL Image Tailor [](https://travis-ci.org/WURLF/angular-wurfl-image-tailor) |
| 2 | + |
| 3 | +> An AngularJS directive for WURFL Image Tailor (WIT) |
| 4 | +
|
| 5 | +[WURFL Image Tailor](http://wurfl.io/#wit) (WIT) is an automatic image tailor based on WURFL device detection. WURFL will detect the device, and its screen size, resize and optimize the image accordingly. |
| 6 | + |
| 7 | +##Features |
| 8 | + |
| 9 | +* Add the img-wit directive |
| 10 | +* Enable out of the box support for the [WIT URLs](http://wurfl.io/documentation/wit-getting-started.php) to download more images in parallel. |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +### Install with bower |
| 15 | +* `bower install angular-wurfl-image-tailor --save` |
| 16 | +* Include `angular-wurfl-image-tailor.js`. It should be located at `bower_components/src/angular-wurfl-image-tailor.js` |
| 17 | + |
| 18 | +### Install from source |
| 19 | +* [Download Latest Version](https://github.com/WURLF/angular-wurfl-image-tailor/releases) and extract the archive. |
| 20 | +* Include `angular-wurfl-image-tailor.js`. It should be located at `archive_path/src/angular-wurfl-image-tailor.js` |
| 21 | + |
| 22 | +### How to use it |
| 23 | + |
| 24 | +* Include the angular-wurfl-image-tailor directive dependency on your angular module: |
| 25 | + |
| 26 | +`var app = angular.module("demoapp", ["angular-wurfl-image-tailor"]);` |
| 27 | + |
| 28 | +* Include the markup directive on your HTML page, like this: |
| 29 | + |
| 30 | +`<img-wit src="http://yourserver.com/image.png"></img-wit>` |
| 31 | + |
| 32 | +## Examples |
| 33 | + |
| 34 | +Check the [WURFL Image Tailor Documentation](http://wurfl.io/documentation/wit-directives.php) for the list of available settings. |
| 35 | + |
| 36 | +### Fully Automatic |
| 37 | + |
| 38 | +`<img-wit src="http://yourserver.com/image.png"></img-wit>` |
| 39 | + |
| 40 | +### 20% of screen size |
| 41 | + |
| 42 | +`<img-wit src="http://yourserver.com/image.png" pc="20"></img-wit>` |
| 43 | + |
| 44 | +### Create an image 300px Wide |
| 45 | + |
| 46 | +`<img-wit src="http://yourserver.com/image.png" w="300"></img-wit>` |
| 47 | + |
| 48 | +### Create 200x200px Thumbnails with Black Letterboxes/Pillarboxes |
| 49 | + |
| 50 | +`<img-wit src="http://yourserver.com/image.png" w="200" h="200" m="letterbox_000000_100"></img-wit>` |
| 51 | + |
| 52 | +## Demo |
| 53 | + |
| 54 | +* Run: `npm start` |
| 55 | +* Browse: `http://localhost:8000/demo/index.html` |
| 56 | + |
| 57 | +## Authors |
| 58 | + |
| 59 | +- [Luca Corbo](https://github.com/lucor) — [view contributions](https://github.com//WURLF/angular-wurfl-image-tailor/commits?author=lucor) |
| 60 | + |
| 61 | +## License |
| 62 | + |
| 63 | +Licensed under the MIT license. (See the LICENSE file) |
| 64 | + |
| 65 | +Copyright © ScientiaMobile, Inc. |
0 commit comments