now exporting files with extension appended

user can now specify output filename without extension, because this is
handled by qr internally now
pull/1/head
Michael Ochmann 2 years ago
parent 128e9638c4
commit df98a2279e
  1. 2
      CMakeLists.txt
  2. 2
      main.cpp
  3. 2
      src/PNGRenderer.hpp
  4. 2
      src/SVGRenderer.hpp

@ -12,7 +12,7 @@ set(EXE_NAME "qr_${CMAKE_PROJECT_VERSION}-${ARCH}")
project(
qr
VERSION 1.0.1
VERSION 1.1.0
LANGUAGES CXX
)

@ -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"

@ -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);
}
};

@ -41,7 +41,7 @@ namespace massivedynamic {
file << "</svg>" << std::endl;
std::ofstream outFile;
outFile.open(filename);
outFile.open(filename + ".svg");
outFile << file.str();
outFile.close();
}

Loading…
Cancel
Save