2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-23 03:41:23 +00:00

Use safe_move_file to create thumbnail image

This commit is contained in:
Aode (lion) 2021-08-29 12:12:22 -05:00
parent c5680c8caf
commit 3066e4d350
3 changed files with 3 additions and 3 deletions

2
Cargo.lock generated
View file

@ -995,7 +995,7 @@ dependencies = [
[[package]] [[package]]
name = "pict-rs" name = "pict-rs"
version = "0.3.0-alpha.16" version = "0.3.0-alpha.17"
dependencies = [ dependencies = [
"actix-form-data", "actix-form-data",
"actix-fs", "actix-fs",

View file

@ -1,7 +1,7 @@
[package] [package]
name = "pict-rs" name = "pict-rs"
description = "A simple image hosting service" description = "A simple image hosting service"
version = "0.3.0-alpha.16" version = "0.3.0-alpha.17"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0" license = "AGPL-3.0"
readme = "README.md" readme = "README.md"

View file

@ -405,7 +405,7 @@ async fn process(
actix_fs::copy(original_path, orig_file.clone()).await?; actix_fs::copy(original_path, orig_file.clone()).await?;
magick::process_image(&orig_file, &dest_file, thumbnail_args, format).await?; magick::process_image(&orig_file, &dest_file, thumbnail_args, format).await?;
actix_fs::remove_file(orig_file).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 { let details = if let Some(details) = details {
details details