diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a9108c..091f0d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(EXE_NAME "qr_${CMAKE_PROJECT_VERSION}-${ARCH}") project( qr - VERSION 1.0.1 + VERSION 1.1.0 LANGUAGES CXX ) diff --git a/main.cpp b/main.cpp index 2114099..93a0848 100644 --- a/main.cpp +++ b/main.cpp @@ -20,7 +20,7 @@ Usage: -f --format output file format. can be one of "cli, png, svg" -h --help show this help -i --input take data from this argument instead of stdin - -o --output output file name + -o --output output file name without extension -s --size desired output file size in pixels -t --type output QR code type. can be one of "small, medium, large" diff --git a/src/PNGRenderer.hpp b/src/PNGRenderer.hpp index ddd8b54..a0de5d7 100644 --- a/src/PNGRenderer.hpp +++ b/src/PNGRenderer.hpp @@ -13,7 +13,7 @@ class PNGRenderer : public PixelRenderer { virtual void render(const std::string& filename) override { this->generateBuffer(); - stbi_write_png(filename.c_str(), targetSize, targetSize, 4, this->bitmap.data(), sizeof(Color) * targetSize); + stbi_write_png((filename + ".png").c_str(), targetSize, targetSize, 4, this->bitmap.data(), sizeof(Color) * targetSize); } }; diff --git a/src/SVGRenderer.hpp b/src/SVGRenderer.hpp index a7a564f..ded525b 100644 --- a/src/SVGRenderer.hpp +++ b/src/SVGRenderer.hpp @@ -41,7 +41,7 @@ namespace massivedynamic { file << "" << std::endl; std::ofstream outFile; - outFile.open(filename); + outFile.open(filename + ".svg"); outFile << file.str(); outFile.close(); }