Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imazen/slimresponse
Painless responsive images for .Net with Slimmage and ImageResizer
https://github.com/imazen/slimresponse
Last synced: about 2 months ago
JSON representation
Painless responsive images for .Net with Slimmage and ImageResizer
- Host: GitHub
- URL: https://github.com/imazen/slimresponse
- Owner: imazen
- Created: 2013-06-13T10:01:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-05T19:58:10.000Z (almost 11 years ago)
- Last Synced: 2024-10-02T19:29:36.888Z (3 months ago)
- Language: C#
- Size: 3.15 MB
- Stars: 11
- Watchers: 9
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## SlimResponse
### Effortless reponsive images powered by [ImageResizer](http://imageresizing.net) and [Slimmage.js](https://github.com/imazen/slimmage)
Dual-licensed by Imazen under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [Apache](http://www.apache.org/licenses/LICENSE-2.0.html) licenses.
`Install-Package Imazen.SlimResponse`
(Well, actually, you may also need to run `Install-Package HtmlAgilityPack`) The current release forgot to specify that dependency.
###What does it to?
SlimResponse looks through outgoing HTML for `` tags with a `slimmage` class applied, such as
```html
```or for "slimmage=true" in any image URL
```html
```**Slimmage requires "width=[number]" be present in the URL. This value specifies the image size when javascript is disabled, but is modified by slimmage.js under normal circumstances.**
It then adds the appropriate markup to allow [slimmage.js](https://github.com/imazen/slimmage) to turn them into responsive images.
### Requirements
* ASP.Net 4.0
* [ImageResizer](http://imageresizing.net) must be [installed](http://imageresizing.net/docs/install)
* [slimmage.js](https://github.com/imazen/slimmage) must be included in your page's javascript.### Spin it up quickly for a test!
* Use WebMatrix or VisualStudio (Open Web Site) and fire it up on the "www"-folder, that's all!### Notes & Caveats
* This parses all outgoing HTML. This may increase CPU usage slightly.
* Outgoing HTML is only modified if a responsive image is present.
* SlimResponse may mess up invalid HTML even further during parsing/serialization.
* If you're only using responsive images in limited situations, an HTML helper that spits out [slimmage markup](https://github.com/imazen/slimmage) may be more appropriate.
* SlimResponse does not include the [slimmage.js](https://github.com/imazen/slimmage) javascript file, that's your responsibility.### Your web.config file must have both ImageResizer and SlimResponse installed
```xml
```
Thanks to [esn303](https://twitter.com/#!/esn303) for creating [ImageResizer.ResponsivePresets](https://github.com/mindrevolution/ImageResizer-ResponsivePresets) and being the inspiration behind this project.
This project is open to collaboration. **Fork. Push. Innovate.**