page rewrite
Some checks failed
CI / Check typos (push) Successful in 1m3s
CI / Check links (push) Failing after 1m14s
CI / Clippy (push) Successful in 1m43s
CI / Build and test (push) Successful in 1m31s
CI / Build container (push) Successful in 1m45s
CI / Deploy on waypoint (push) Failing after 1m23s
Some checks failed
CI / Check typos (push) Successful in 1m3s
CI / Check links (push) Failing after 1m14s
CI / Clippy (push) Successful in 1m43s
CI / Build and test (push) Successful in 1m31s
CI / Build container (push) Successful in 1m45s
CI / Deploy on waypoint (push) Failing after 1m23s
This commit is contained in:
@@ -38,6 +38,20 @@ impl TransformerChain {
|
||||
return image;
|
||||
}
|
||||
|
||||
pub fn output_mime(&self, input_mime: &MimeType) -> Option<MimeType> {
|
||||
let mime = self
|
||||
.steps
|
||||
.last()
|
||||
.and_then(|x| match x {
|
||||
TransformerEnum::Format { format } => Some(MimeType::from(format.to_mime_type())),
|
||||
_ => None,
|
||||
})
|
||||
.unwrap_or(input_mime.clone());
|
||||
|
||||
let fmt = ImageFormat::from_mime_type(mime.to_string());
|
||||
fmt.map(|_| mime)
|
||||
}
|
||||
|
||||
pub fn transform_bytes(
|
||||
&self,
|
||||
image_bytes: &[u8],
|
||||
|
||||
Reference in New Issue
Block a user