Skip to content

Commit 107b220

Browse files
Update web docs
1 parent 9ee0fbb commit 107b220

File tree

9 files changed

+157
-8
lines changed

9 files changed

+157
-8
lines changed

api/toc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
href: ImageSharp.Web/SixLabors.ImageSharp.Web.yml
77
- name: ImageSharp.Web.Providers.Azure
88
href: ImageSharp.Web.Providers.Azure/SixLabors.ImageSharp.Web.Providers.Azure.yml
9+
- name: ImageSharp.Web.Providers.AWS
10+
href: ImageSharp.Web.Providers.AWS/SixLabors.ImageSharp.Web.Providers.AWS.yml
911
- name: Fonts
1012
href: Fonts/SixLabors.Fonts.yml

articles/imagesharp.web/gettingstarted.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services.AddImageSharp(
3636
options.MemoryStreamManager = new RecyclableMemoryStreamManager();
3737
options.BrowserMaxAge = TimeSpan.FromDays(7);
3838
options.CacheMaxAge = TimeSpan.FromDays(365);
39-
options.CachedNameLength = 8;
39+
options.CachedHashLength = 8;
4040
options.OnParseCommandsAsync = _ => Task.CompletedTask;
4141
options.OnBeforeSaveAsync = _ => Task.CompletedTask;
4242
options.OnProcessedAsync = _ => Task.CompletedTask;

articles/imagesharp.web/imagecaches.md

+54-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following caches are available for the middleware.
99

1010
### PhysicalFileSystemCache
1111

12-
The @"SixLabors.ImageSharp.Web.Caching.PhysicalFileSystemCache" stores processed image files in the [web root](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-3.1&tabs=macos#web-root) folder. This is the default cache installed when configuring the middleware.
12+
The @"SixLabors.ImageSharp.Web.Caching.PhysicalFileSystemCache", by default, stores processed image files in the [web root](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-3.1&tabs=macos#web-root) folder. This is the default cache installed when configuring the middleware.
1313

1414
Images are cached in separate folders based upon a hash of the request URL. this allows the caching of millions of image files without slowing down the file system.
1515

@@ -62,3 +62,56 @@ Once installed the cache @SixLabors.ImageSharp.Web.Caching.Azure.AzureBlobStorag
6262
```
6363

6464
Images are cached using a hash of the request URL as the blob name. All appropriate metadata is stored in the blob properties to correctly serve the blob with the correct response headers.
65+
66+
67+
### AWSS3StorageCache
68+
69+
This cache allows the caching of image files using [Amazon Simple Storage Service (Amazon S3)](https://aws.amazon.com/s3/) and is available as an external package installable via [NuGet](https://www.nuget.org/packages/SixLabors.ImageSharp.Web.Providers.AWS)
70+
71+
# [Package Manager](#tab/tabid-1a)
72+
73+
```bash
74+
PM > Install-Package SixLabors.ImageSharp.Web.Providers.AWS -Version VERSION_NUMBER
75+
```
76+
77+
# [.NET CLI](#tab/tabid-2a)
78+
79+
```bash
80+
dotnet add package SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER
81+
```
82+
83+
# [PackageReference](#tab/tabid-3a)
84+
85+
```xml
86+
<PackageReference Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="VERSION_NUMBER" />
87+
```
88+
89+
# [Paket CLI](#tab/tabid-4a)
90+
91+
```bash
92+
paket add SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER
93+
```
94+
95+
***
96+
97+
Once installed the cache @SixLabors.ImageSharp.Web.Caching.AWS.AWSS3StorageCacheOptions can be configured as follows:
98+
99+
100+
```c#
101+
// Configure and register the bucket.
102+
// Alteratively use `appsettings.json` to represent the class and bind those settings.
103+
.Configure<AWSS3StorageCacheOptions>(options =>
104+
{
105+
options.Endpoint = {AWS_ENDPOINT};
106+
options.BucketName = {AWS_BUCKET_NAME};
107+
options.AccessKey = {AWS_ACCESS_KEY};
108+
options.AccessSecret = {AWS_ACCESS_SECRET};
109+
options.Region = {AWS_REGION};
110+
111+
// Optionally create the cache bucket on startup if not already created.
112+
AWSS3StorageCache.CreateIfNotExists(options, S3CannedACL.Private);
113+
})
114+
.SetCache<AzureBlobStorageCache>()
115+
```
116+
117+
Images are cached using a hash of the request URL as the object name. All appropriate metadata is stored in the object properties to correctly serve the object with the correct response headers.

articles/imagesharp.web/imageproviders.md

+58-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Once installed the provider @"SixLabors.ImageSharp.Web.Providers.Azure.AzureBlob
4747

4848

4949
```c#
50-
// Configure and register the container.
50+
// Configure and register the containers.
5151
// Alteratively use `appsettings.json` to represent the class and bind those settings.
5252
.Configure<AzureBlobStorageImageProviderOptions>(options =>
5353
{
@@ -66,3 +66,60 @@ Url requests are matched in accordance to the following rule:
6666
```bash
6767
/{CONTAINER_NAME}/{BLOB_FILENAME}
6868
```
69+
70+
### AWSS3StorageImageProvider
71+
72+
This provider allows the processing and serving of image files from [Amazon Simple Storage Service (Amazon S3)](https://aws.amazon.com/s3/) and is available as an external package installable via [NuGet](https://www.nuget.org/packages/SixLabors.ImageSharp.Web.Providers.AWS)
73+
74+
# [Package Manager](#tab/tabid-1a)
75+
76+
```bash
77+
PM > Install-Package SixLabors.ImageSharp.Web.Providers.AWS -Version VERSION_NUMBER
78+
```
79+
80+
# [.NET CLI](#tab/tabid-2a)
81+
82+
```bash
83+
dotnet add package SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER
84+
```
85+
86+
# [PackageReference](#tab/tabid-3a)
87+
88+
```xml
89+
<PackageReference Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="VERSION_NUMBER" />
90+
```
91+
92+
# [Paket CLI](#tab/tabid-4a)
93+
94+
```bash
95+
paket add SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER
96+
```
97+
98+
***
99+
100+
Once installed the cache @SixLabors.ImageSharp.Web.Providers.AWS.AWSS3StorageImageProviderOptions can be configured as follows:
101+
102+
103+
```c#
104+
// Configure and register the buckets.
105+
// Alteratively use `appsettings.json` to represent the class and bind those settings.
106+
.Configure<AWSS3StorageImageProviderOptions>(options =>
107+
{
108+
// The "S3Buckets" collection allows registration of multiple buckets.
109+
options.S3Buckets.Add(new AWSS3BucketClientOptions
110+
{
111+
options.Endpoint = {AWS_ENDPOINT};
112+
options.BucketName = {AWS_BUCKET_NAME};
113+
options.AccessKey = {AWS_ACCESS_KEY};
114+
options.AccessSecret = {AWS_ACCESS_SECRET};
115+
options.Region = {AWS_REGION};
116+
});
117+
})
118+
.AddProvider<AWSS3StorageImageProviderOptions>()
119+
```
120+
121+
Url requests are matched in accordance to the following rule:
122+
123+
```bash
124+
/{BUCKET_NAME}/{OBJECT_FILENAME}
125+
```

articles/imagesharp.web/processingcommands.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ The following processors are built into the middleware. In addition extension po
1111

1212
Allows the resizing of images.
1313

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.
16+
>This behavior can be turned off per request.
17+
1418
``` bash
1519
{PATH_TO_YOUR_IMAGE}?width=300
1620
{PATH_TO_YOUR_IMAGE}?width=300&height=120&rxy=0.37,0.78
1721
{PATH_TO_YOUR_IMAGE}?width=50&height=50&rsampler=nearest&rmode=stretch
22+
{PATH_TO_YOUR_IMAGE}?width=300&compand=true&orient=false
1823
```
1924
Resize commands represent the @"SixLabors.ImageSharp.Processing.ResizeOptions" class.
2025

@@ -40,26 +45,31 @@ sampler to use.
4045
- `hermite` @"SixLabors.ImageSharp.Processing.KnownResamplers.Hermite"
4146
- `ranchor`The @"SixLabors.ImageSharp.Processing.AnchorPositionMode" to use.
4247
- `rxy` Use an exact anchor position point. The comma-separated x and y values range from 0-1.
43-
- `compand` Whether to compress and expand individual pixel colors values to/from a linear color space when processing.
48+
- `orient` Whether to swap command dimensions based on the presence of EXIF metadata indicating rotated (not flipped) images. Defaults to `true`
49+
- `compand` Whether to compress and expand individual pixel colors values to/from a linear color space when processing. Defaults to `false`
4450

4551

4652
#### Format
4753

4854
Allows the encoding of the output image to a new image format. The available formats depend on your configuration settings.
4955

5056
```
51-
{PATH_TO_YOUR_IMAGE}?format=jpg
57+
{PATH_TO_YOUR_IMAGE}?format=bmp
5258
{PATH_TO_YOUR_IMAGE}?format=gif
59+
{PATH_TO_YOUR_IMAGE}?format=jpg
60+
{PATH_TO_YOUR_IMAGE}?format=pbm
5361
{PATH_TO_YOUR_IMAGE}?format=png
54-
{PATH_TO_YOUR_IMAGE}?format=bmp
5562
{PATH_TO_YOUR_IMAGE}?format=tga
63+
{PATH_TO_YOUR_IMAGE}?format=tiff
64+
{PATH_TO_YOUR_IMAGE}?format=webp
5665
```
5766

5867
#### Quality
5968

6069
Allows the encoding of the output image at the given quality.
6170

6271
- For Jpeg this ranges from 1—100.
72+
- For WebP this ranges from 1—100.
6373

6474
```
6575
{PATH_TO_YOUR_IMAGE}?quality=90
@@ -80,3 +90,11 @@ Allows the changing of the background color of transparent images.
8090
{PATH_TO_YOUR_IMAGE}?bgcolor=128,64,32
8191
{PATH_TO_YOUR_IMAGE}?bgcolor=128,64,32,16
8292
```
93+
94+
#### Auto Orient
95+
96+
Allows the normalization of image orientation based on the source EXIF metadata.
97+
98+
```
99+
{PATH_TO_YOUR_IMAGE}?autoorient=true
100+
```

docfx.json

+15
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@
7474
"properties": {
7575
"TargetFramework": "netcoreapp3.1"
7676
}
77+
},
78+
{
79+
"src": [
80+
{
81+
"files": [
82+
"ext/ImageSharp.Web/src/ImageSharp.Web.Providers.AWS/**.csproj"
83+
]
84+
}
85+
],
86+
"dest": "api/ImageSharp.Web.Providers.AWS",
87+
"disableGitFeatures": false,
88+
"disableDefaultFilter": false,
89+
"properties": {
90+
"TargetFramework": "netcoreapp3.1"
91+
}
7792
}
7893
],
7994
"build": {

templates/styles/main.css

+4
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ header .navbar {
490490
overflow-x: auto !important;
491491
}
492492

493+
.sidetoc.shiftup {
494+
bottom: auto;
495+
}
496+
493497
/* Blast the default styles out of the way so the side nav is usable*/
494498
.sidetoc * {
495499
font-size: 13px !important;

0 commit comments

Comments
 (0)