From e9078b6980eaf22c1f6352930bd36d4a9e85a4b0 Mon Sep 17 00:00:00 2001 From: scratko Date: Thu, 21 Nov 2024 23:01:56 +0300 Subject: Including resources in the object file Convert pictures to array data (image_converter/converter.c) Resources are located in image_converter/resources.o --- img_handler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'img_handler.cpp') 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 #include #include +#include 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 -- cgit v1.2.3