减少 Raw 图片编辑请求拷贝
移动 multipart 选项字段而非克隆 降低掩码和字符串的峰值内存
This commit is contained in:
@@ -111,16 +111,16 @@ pub async fn create_vector_engine_raw_image_edit(
|
||||
.mime_str(image.mime_type.as_str())
|
||||
.map_err(|error| invalid_request(failure_context, error.to_string()))?,
|
||||
);
|
||||
if let Some(value) = options.quality.clone() {
|
||||
if let Some(value) = options.quality {
|
||||
form = form.text("quality", value);
|
||||
}
|
||||
if let Some(value) = options.background.clone() {
|
||||
if let Some(value) = options.background {
|
||||
form = form.text("background", value);
|
||||
}
|
||||
if let Some(value) = options.output_format.clone() {
|
||||
if let Some(value) = options.output_format {
|
||||
form = form.text("output_format", value);
|
||||
}
|
||||
if let Some(mask) = options.mask.clone() {
|
||||
if let Some(mask) = options.mask {
|
||||
form = form.part(
|
||||
"mask",
|
||||
Part::bytes(mask.bytes)
|
||||
|
||||
Reference in New Issue
Block a user