aboutsummaryrefslogtreecommitdiff
path: root/src/FileAnalyzer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FileAnalyzer.cpp')
-rw-r--r--src/FileAnalyzer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp
index a24906f..f1f9369 100644
--- a/src/FileAnalyzer.cpp
+++ b/src/FileAnalyzer.cpp
@@ -137,13 +137,12 @@ namespace QuickMedia {
if(width > 0 && height > 0) {
FileAnalyzer file_analyzer;
- if(file_analyzer.load_file(destination_path_tmp.data.c_str(), false) && create_thumbnail(destination_path_tmp, destination_path, sf::Vector2i(width, height), file_analyzer.get_content_type())) {
- remove(destination_path_tmp.data.c_str());
- return true;
- }
+ const bool success = file_analyzer.load_file(destination_path_tmp.data.c_str(), false) && create_thumbnail(destination_path_tmp, destination_path, sf::Vector2i(width, height), file_analyzer.get_content_type(), false);
+ remove(destination_path_tmp.data.c_str());
+ return success;
+ } else {
+ return rename_atomic(destination_path_tmp.data.c_str(), destination_path) == 0;
}
-
- return rename_atomic(destination_path_tmp.data.c_str(), destination_path) == 0;
}
// TODO: Remove dependency on ffprobe
@@ -221,6 +220,7 @@ namespace QuickMedia {
duration_seconds = std::nullopt;
struct stat stat;
+ memset(&stat, 0, sizeof(stat));
if(fstat(fileno(file), &stat) == -1) {
perror(filepath);
fclose(file);