Skip to content

Commit

Permalink
Create output directories before writing an image
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Dec 29, 2023
1 parent b9a8a97 commit 6ad6acc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Primitives/PrimBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static fs::path writeBmpFile(fs::path aFilePath, const std::vector<uint8_t>& aRa
{
aFilePath.replace_extension(".bmp");

fs::create_directories(aFilePath.parent_path());
std::ofstream img{aFilePath, std::ios::out | std::ios::binary};

if(!img)
Expand Down Expand Up @@ -205,6 +206,7 @@ static fs::path writeNoBmpFile(fs::path aFilePath, const std::vector<uint8_t>& a
spdlog::warn("Unknown image file format");
}

fs::create_directories(aFilePath.parent_path());
std::ofstream img{aFilePath, std::ios::out | std::ios::binary};

if(!img)
Expand Down

0 comments on commit 6ad6acc

Please sign in to comment.