back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/img_handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'img_handler.cpp')
-rw-r--r--img_handler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/img_handler.cpp b/img_handler.cpp
index 8285de6..921f639 100644
--- a/img_handler.cpp
+++ b/img_handler.cpp
@@ -12,10 +12,18 @@
#include <filesystem>
#include <stdio.h>
#include <iostream>
+#include <string>
ImageHandler::ImageHandler(const char *p) : path_to_file(p) {
img_data = nullptr;
resized_data = nullptr;
+ /*
+ * creating resources directory (if it didn't exist)
+ */
+ std::filesystem::path res_path = std::string("resources");
+ if(!std::filesystem::exists(res_path))
+ std::filesystem::create_directory(res_path);
+
#if defined(_WIN32)
auto it = path_to_file.find_last_of('\\');
#else