diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-28 21:17:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-28 21:17:54 +0300 |
commit | 775936f0b29e0ee4ee72ecf1bafe22686d06c86b (patch) | |
tree | 3aa34a64fd7819e6c7edefed0613188eeb616983 /intern | |
parent | da1323d1c95095feff98e8aa054d73fd323c363d (diff) | |
parent | e395c82d1fa2bf66ba0b91570dcfe0b9b0cc8cf9 (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/denoising.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/render/denoising.cpp b/intern/cycles/render/denoising.cpp index 2fceee09c78..a89cb97c4d8 100644 --- a/intern/cycles/render/denoising.cpp +++ b/intern/cycles/render/denoising.cpp @@ -755,7 +755,9 @@ bool DenoiseImage::save_output(const string& out_filepath, string& error) /* Write to temporary file path, so we denoise images in place and don't * risk destroying files when something goes wrong in file saving. */ - string tmp_filepath = OIIO::Filesystem::temp_directory_path() + "/" + OIIO::Filesystem::unique_path() + ".exr"; + string extension = OIIO::Filesystem::extension(out_filepath); + string unique_name = ".denoise-tmp-" + OIIO::Filesystem::unique_path(); + string tmp_filepath = out_filepath + unique_name + extension; unique_ptr<ImageOutput> out(ImageOutput::create(tmp_filepath)); if(!out) { @@ -783,17 +785,17 @@ bool DenoiseImage::save_output(const string& out_filepath, string& error) out.reset(); /* Copy temporary file to outputput filepath. */ - if(ok && !OIIO::Filesystem::rename(tmp_filepath, out_filepath)) { - error = "Failed to save to file " + out_filepath + ": " + out->geterror(); + string rename_error; + if(ok && !OIIO::Filesystem::rename(tmp_filepath, out_filepath, rename_error)) { + error = "Failed to move denoised image to " + out_filepath + ": " + rename_error; ok = false; } if(!ok) { OIIO::Filesystem::remove(tmp_filepath); - return false; } - return true; + return ok; } /* File pattern handling and outer loop over frames */ |