ImageOptimizerOptions
12345678910111213141516171819202122232425262728293031323334#[non_exhaustive]pub struct ImageOptimizerOptions {}ImageOptimizerOptions contains options that correspond to the public API.
Fields
region
Option<ImageOptimizerRegion>Indicates where image transformations will occur. Must be set.
See ImageOptimizerRegion for available options. The chosen region should be close to
your origin.
preserve_query_string_on_origin_request
Option<bool>If true, preserves query parameters not belonging to the Image Optimizer API when requesting the origin image.
allow_malformed_query_params
Option<bool>If true, ignores malformed and duplicate query parameters and returns a
response header, Fastly-Io-Compute-Warnings, containing a comma
separated list of errors (if there are any).
By default IO on compute is strict when parsing query parameters, and
passing an invalid or malformed value produces an HTTP 400 response.
This behavior is different than IO running in VCL services where most
errors fail silently. Setting this parameter to true should make the
behavior more in line with VCL services.
Sets a background color when replacing transparent pixels
or with pad or canvas.
brightness
Option<i32>Adjusts image brightness.
contrast
Option<i32>Adjusts image contrast.
dpr
Option<f32>Ratio between physical and logical pixels, a float between 0-10.
Adjusts any resize requests according to this ratio.
Allows for various image transformations to occur, particularly upscaling images.
frame
Option<u32>Request a single frame for an animated image.
Currently only supported for animated GIFs.
height
Option<PixelsOrPercentage>Adjusts image height.
For use with GIF to MP4 conversions.
See https://www.fastly.com/documentation/reference/io/level/ for detailed information.
optimize
Option<OptimizeLevel>Attempts to select an output quality to optimize the image.
orient
Option<Orientation>Controls how the image will be oriented.
For use with GIF to MP4 conversions.
See https://www.fastly.com/documentation/reference/io/level/ for detailed information.
quality
Option<u32>Request an output quality.
resize_filter
Option<ResizeAlgorithm>Specify which algorithm to use when resizing an image.
saturation
Option<i32>Adjust image saturation.
width
Option<PixelsOrPercentage>Adjusts image width.
Methods
from_region
View sourceCreate ImageOptimizerOptions for the specified region. It is recommended to pick a region closest to your origin that serves images.
See Request::set_image_optimizer for example usage.
Parameters
- region: ImageOptimizerRegion
Returns
Trait implementations
impl Clone for ImageOptimizerOptions
impl Debug for ImageOptimizerOptions
impl Default for ImageOptimizerOptions
impl Serialize for ImageOptimizerOptions
serialize
View sourcewhere __S: Serializer,Parameters
- self: &Self
- __serializer: __S
Returns