From 3066e4d350889fd2a19cce1cc86f8885f625ee8b Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Sun, 29 Aug 2021 12:12:22 -0500 Subject: [PATCH] Use safe_move_file to create thumbnail image --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee99d91..5208453 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -995,7 +995,7 @@ dependencies = [ [[package]] name = "pict-rs" -version = "0.3.0-alpha.16" +version = "0.3.0-alpha.17" dependencies = [ "actix-form-data", "actix-fs", diff --git a/Cargo.toml b/Cargo.toml index 60b93b4..3d9aed0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pict-rs" description = "A simple image hosting service" -version = "0.3.0-alpha.16" +version = "0.3.0-alpha.17" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/src/main.rs b/src/main.rs index 9721a6d..4f483ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -405,7 +405,7 @@ async fn process( actix_fs::copy(original_path, orig_file.clone()).await?; magick::process_image(&orig_file, &dest_file, thumbnail_args, format).await?; actix_fs::remove_file(orig_file).await?; - actix_fs::rename(dest_file, thumbnail_path.clone()).await?; + safe_move_file(dest_file, thumbnail_path.clone()).await?; let details = if let Some(details) = details { details