Class Thumbnailer
Makes thumbnails of images: one of a few standard sizes, cropped or scaled, never larger than the image.
Namespace: Uniform.Matrix.Server.Media
Assembly: Uniform.Matrix.Server.dll
public static class Thumbnailer
Fields
|
Edit this page
View Source
Thumbnail method that fills the size and crops the rest.
Declaration
public const string Crop = "crop"
Field Value
|
Edit this page
View Source
Thumbnail method that fits the image inside the size.
Declaration
public const string Scale = "scale"
Field Value
Methods
|
Edit this page
View Source
Return whether thumbnails can be made from contentType.
Declaration
public static bool CanThumbnail(string contentType)
Parameters
| Type |
Name |
Description |
| string |
contentType |
|
Returns
|
Edit this page
View Source
Return the standard size to make for a request: the smallest of the method at least as large, else the largest.
Declaration
public static (int Width, int Height, string Method) ChooseSize(int width, int height, string method)
Parameters
Returns
|
Edit this page
View Source
Make a thumbnail of an image; return null when it cannot be decoded or has more than maxPixels pixels.
Declaration
public static (byte[] Data, string ContentType)? Create(byte[] image, int width, int height, string method, long maxPixels)
Parameters
Returns