Class ImageTransformRequest
Typed, validated view of the URL transform contract produced by
CoreUpload.transformUrl() on the client
(?w=&h=&fit=&format=&q=&crop=&blur=&gravity=&rotate=&flip=&grayscale=&wm=&wmpos=).
IImageTransformer implementations receive the raw IQueryCollection; call Parse(IQueryCollection) to get clamped, whitelist-validated values instead of re-parsing strings. Invalid or out-of-range values are dropped (never throw) so a malformed URL degrades to the original image rather than a 500.
Inherited Members
Namespace: CoreUpload.Providers
Assembly: CoreUpload.dll
Syntax
public sealed class ImageTransformRequest
Fields
TransformKeys
Query keys that trigger a transform when present.
Declaration
public static readonly string[] TransformKeys
Field Value
| Type | Description |
|---|---|
| string[] |
Properties
Blur
Gaussian blur radius in pixels (1-100), or null.
Declaration
public int? Blur { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Crop
Crop rectangle parsed from 'x,y,w,h', or null.
Declaration
public (int X, int Y, int W, int H)? Crop { get; }
Property Value
| Type | Description |
|---|---|
| (int X, int Y, int W, int H)? |
Fit
Fit mode: cover|contain|inside|outside, or null.
Declaration
public string? Fit { get; }
Property Value
| Type | Description |
|---|---|
| string |
Flip
Flip axis: h|v|hv, or null.
Declaration
public string? Flip { get; }
Property Value
| Type | Description |
|---|---|
| string |
Format
Output format: jpeg|webp|avif|png, or null.
Declaration
public string? Format { get; }
Property Value
| Type | Description |
|---|---|
| string |
Gravity
Crop/resize gravity: compass point, smart, or face. Null = center.
Declaration
public string? Gravity { get; }
Property Value
| Type | Description |
|---|---|
| string |
Grayscale
True when grayscale output was requested.
Declaration
public bool Grayscale { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasAny
True when at least one valid transform was parsed.
Declaration
public bool HasAny { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Height
Target height in pixels (1-10000), or null.
Declaration
public int? Height { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Quality
Quality 1-100, or null.
Declaration
public int? Quality { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Rotate
Rotation in degrees: 90, 180 or 270, or null.
Declaration
public int? Rotate { get; }
Property Value
| Type | Description |
|---|---|
| int? |
WatermarkPosition
Watermark position (compass point or center). Null = southeast.
Declaration
public string? WatermarkPosition { get; }
Property Value
| Type | Description |
|---|---|
| string |
WatermarkText
Watermark text (max 64 chars), or null.
Declaration
public string? WatermarkText { get; }
Property Value
| Type | Description |
|---|---|
| string |
Width
Target width in pixels (1-10000), or null.
Declaration
public int? Width { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Methods
HasTransformParams(IQueryCollection)
True when the query contains at least one recognized transform key.
Declaration
public static bool HasTransformParams(IQueryCollection query)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueryCollection | query |
Returns
| Type | Description |
|---|---|
| bool |
Parse(IQueryCollection)
Parse and validate the transform parameters from a query collection.
Declaration
public static ImageTransformRequest Parse(IQueryCollection query)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueryCollection | query |
Returns
| Type | Description |
|---|---|
| ImageTransformRequest |