This commit is contained in:
asonix 2023-09-24 12:42:23 -05:00
parent 9ffdd0432f
commit 8f62b0c325
3 changed files with 6 additions and 7 deletions

View File

@ -31,7 +31,7 @@ where
let output_arg = format!("{}:-", format.magick_format());
let quality = quality.map(|q| q.to_string());
let len = format.coalesce().then(|| 4).unwrap_or(3) + quality.is_some().then(|| 1).unwrap_or(0);
let len = 3 + if format.coalesce() { 1 } else { 0 } + if quality.is_some() { 1 } else { 0 };
let mut args: Vec<&str> = Vec::with_capacity(len);
args.push("convert");

View File

@ -82,7 +82,7 @@ where
}
};
let processed_reader = crate::magick::process_image_async_read(
crate::magick::process_image_async_read(
validated_reader,
magick_args,
format,
@ -90,9 +90,7 @@ where
quality,
media.process_timeout,
)
.await?;
processed_reader
.await?
} else {
validated_reader
}

View File

@ -117,8 +117,9 @@ where
let output_arg = format!("{}:-", format.magick_format());
let quality = quality.map(|q| q.to_string());
let len = format.coalesce().then(|| 4).unwrap_or(3)
+ quality.is_some().then(|| 1).unwrap_or(0)
let len = 3
+ if format.coalesce() { 1 } else { 0 }
+ if quality.is_some() { 1 } else { 0 }
+ process_args.len();
let mut args: Vec<&str> = Vec::with_capacity(len);