You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/imagesharp.web/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Introduction
2
2
3
3
### What is ImageSharp.Web?
4
-
ImageSharp.Web is a high performance ASP.NET Core Middleware built on top of ImageSharp that allows the processing and caching of image requests via a simple API.
4
+
ImageSharp.Web is a high performance ASP.NET 6 Middleware built on top of ImageSharp that allows the processing and caching of image requests via a simple API.
5
5
6
6
ImageSharp.Web is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional extensions to add image sources, caching mechanisms or even your own processing API.
7
7
8
8
### License
9
-
Imagesharp.Web is licensed under under the terms of [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0). Commercial support licensing options are available in addition to this license, see https://sixlabors.com/pricing for details.
9
+
ImageSharp.Web is licensed under the terms of the [Six Labors Split License, Version 1.0](https://github.com/SixLabors/ImageSharp.Web/blob/main/LICENSE). See https://sixlabors.com/pricing for commercial licensing details.
Copy file name to clipboardExpand all lines: articles/imagesharp.web/processingcommands.md
+47-2Lines changed: 47 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The following processors are built into the middleware. In addition extension po
12
12
Allows the resizing of images.
13
13
14
14
>[!NOTE]
15
-
>In V2 this processor will automatically correct the order of dimensional commands based on the presence of EXIF metadata indicating rotated (not flipped) images.
15
+
>In V3 this processor will automatically correct the order of dimensional commands based on the presence of EXIF metadata indicating rotated (not flipped) images.
Users can replicate that key using the same @SixLabors.ImageSharp.Web.CaseHandlingUriBuilder and @SixLabors.ImageSharp.Web.HMACUtilities APIs to generate the HMAC hash on the client. The hash must be passed via a command using the @SixLabors.ImageSharp.Web.HMACUtilities.TokenCommand constant.
122
122
123
-
Any invalid matches are rejected at the very start of the processing pipeline with a 400 HttpResponse code.
123
+
Any invalid matches are rejected at the very start of the processing pipeline with a 400 HttpResponse code.
124
+
125
+
## ImageTagHelper
126
+
127
+
ASP.NET tag helpers are useful because they provide a more natural syntax for creating HTML elements in server-side code. They allow developers to create HTML elements in a way that is similar to how they would write HTML markup in a Razor view.
128
+
129
+
Some of the benefits of using tag helpers include:
130
+
131
+
1. Improved readability: Tag helpers make it easier to understand the purpose of the code by providing a clear and concise syntax that is closer to HTML.
132
+
2. Reduced complexity: Tag helpers simplify the creation of complex HTML elements by reducing the amount of boilerplate code needed.
133
+
3. Type safety: Tag helpers are strongly typed, which means that the compiler can catch errors at compile time rather than at runtime.
134
+
4. Testability: Tag helpers make it easier to unit test server-side code by providing a cleaner separation of concerns between the server-side code and the HTML markup.
135
+
5. Code reuse: Tag helpers can be used to encapsulate commonly used HTML elements, making it easier to reuse code across multiple views and pages.
136
+
137
+
Overall, ASP.NET tag helpers provide a more efficient and maintainable way to create HTML elements in server-side code.
138
+
139
+
ImageSharp.Web v3.0.0 comes equipped with a custom tag helper that allows the generation of all the commands supported by the middleware in an easily accessible manner. This includes automatic generation of HMAC command tokens.
140
+
141
+
>[!NOTE]
142
+
>Using @SixLabors.ImageSharp.Web.TagHelpers.ImageTagHelper is the recommended way to generate processing commands.
143
+
144
+
To use @SixLabors.ImageSharp.Web.TagHelpers.ImageTagHelper, add the following imports command to `_ViewImports.cshtml` in your project.
145
+
146
+
```html
147
+
@addTagHelper *, SixLabors.ImageSharp.Web
148
+
```
149
+
150
+
All ImageSharp.Web commands are strongly typed and prefixed with `imagesharp` to namespace them against potentially conflicting commands. Visual Studio intellisense with automatically provide guidance
151
+
once you start typing. For example, the following markup...
152
+
153
+
```html
154
+
<img
155
+
src="sixlabors.imagesharp.web.png"
156
+
imagesharp-width="300"
157
+
imagesharp-height="200"
158
+
imagesharp-rmode="ResizeMode.Pad"
159
+
imagesharp-rcolor="Color.LimeGreen" />
160
+
```
161
+
162
+
Will generate the following command when HMAC is enabled.
0 commit comments