Expand description
Generates and stores still and animated thumbnail variants.
Re-exportsΒ§
use std::cmp::min;πuse std::io::Cursor;πuse image::DynamicImage;πuse image::ImageFormat;πuse image::ImageReader;πuse image::Limits;πuse image::imageops::FilterType;πuse ruma::Mxc;πuse ruma::http_headers::ContentDisposition;πuse ruma::http_headers::ContentDispositionType;πuse ruma::media::Method;πuse tuwunel_core::Err;πuse tuwunel_core::Result;πuse tuwunel_core::err;πuse tuwunel_core::implement;πuse tuwunel_core::utils::BoolExt;πuse super::super::Media;πuse super::super::data::Metadata;πuse super::Animate;πuse super::Dim;πuse super::request::into_media;πuse super::sniff::Sequence;πuse super::sniff::sequence;π
ConstantsΒ§
- BYTES_
PER_ πPIXEL - Bytes the decoder is budgeted per pixel of the picture it is asked for.
- PNG π
- Content type of every still thumbnail tuwunel generates.
- STILL_
NAME π - Filename a generated still thumbnail is disposed under, per the media repository specification, rather than the source filename.
FunctionsΒ§
- animates_
at π - Whether this source yields an animated variant at these dimensions.
- decoder_
limits π - Creates decoder limits from the configured pixel budget.
- encode_
png π - Encodes one still thumbnail into a PNG buffer.
- header_
dim π - The dimensions this pictureβs own header declares.
- limited_
reader π - Creates an image reader with the configured allocation limit.
- picture_
dim π - The size a picture that may not be served stands in at.
- reader π
- Creates an image reader for encoded picture bytes.
- thumbnail_
generate π - Resizes a decoded picture to the requested dimensions.