aboutsummaryrefslogtreecommitdiff
path: root/src/FileAnalyzer.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-08 10:48:55 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-08 10:48:55 +0200
commit23ab8cc08d2d6281ef56c184f1e1e905e70a2a22 (patch)
treedf1c2d59db08da7ea12e9359b7583e622a8ff0f2 /src/FileAnalyzer.cpp
parent244ee01df48d702ff126a73ee36911b43adfdba8 (diff)
Matrix: fix thumbnail upload of small thumbnails, fix small thumbnail creation if webp
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);