update code level
This commit is contained in:
@@ -85,8 +85,8 @@ impl ImageProcessor {
|
||||
// 使用快速解码和缩放
|
||||
let img = image::load_from_memory(image_data)?;
|
||||
|
||||
// 快速缩放到小尺寸(200x150)
|
||||
let thumbnail = img.thumbnail(200, 150);
|
||||
// 快速缩放到小尺寸(200x200)
|
||||
let thumbnail = img.thumbnail(200, 200);
|
||||
|
||||
// 使用低质量JPEG压缩以加快编码速度
|
||||
let mut output = Vec::new();
|
||||
@@ -165,8 +165,8 @@ impl ImageProcessor {
|
||||
// 加载图片
|
||||
let img = image::load_from_memory(image_data)?;
|
||||
|
||||
// 生成缩略图(400x300,保持宽高比)
|
||||
let thumbnail = img.thumbnail(600, 400);
|
||||
// 生成缩略图(600x600,保持宽高比)
|
||||
let thumbnail = img.thumbnail(600, 600);
|
||||
|
||||
// 将缩略图数据保存到内存缓冲区
|
||||
let mut buffer = std::io::Cursor::new(Vec::new());
|
||||
|
||||
Reference in New Issue
Block a user