From 86dffe51ac461da9a154df12e90b1baa82e0af07 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Sun, 6 Oct 2024 15:39:41 -0400 Subject: [PATCH] tweaks --- Makefile | 2 +- src/helpers.cpp | 1 + src/tile-smush.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 97b0d611..026c2631 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,6 @@ install: install -m 0755 tile-smush $(DESTDIR)$(prefix)/bin/ clean: - rm -f tile-smush src/*.o src/external/*.o include/*.o include/*.pb.h server/*.o test/*.o rm test.* + rm -f tile-smush src/*.o src/external/*.o include/*.o include/*.pb.h server/*.o test/*.o rm test.* src/external/libdeflate/lib/*.o ./src/external/libdeflate/lib/*/*.o .PHONY: install diff --git a/src/helpers.cpp b/src/helpers.cpp index 15a413f9..92212b98 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -75,6 +75,7 @@ std::string compress_string(const std::string& str, size_t maxSize = libdeflate_gzip_compress_bound(compressor.compressor, str.size()); rv.resize(maxSize); + //std::cout << "compressing str with size " << std::to_string(str.size()) << " maxSize=" << std::to_string(maxSize) << " rv.size()=" << std::to_string(rv.size()) << std::endl; size_t compressedSize = libdeflate_gzip_compress(compressor.compressor, str.data(), str.size(), &rv[0], maxSize); if (compressedSize == 0) throw std::runtime_error("libdeflate_gzip_compress failed"); diff --git a/src/tile-smush.cpp b/src/tile-smush.cpp index 7e7ec398..59a8ae4c 100644 --- a/src/tile-smush.cpp +++ b/src/tile-smush.cpp @@ -299,7 +299,7 @@ int main(const int argc, const char* argv[]) { std::string buffer; builder.serialize(buffer); - std::string compressed = compress_string(buffer, 9, true); + std::string compressed = compress_string(buffer, 6, true); merged.saveTile(zoom, x, y, &compressed, false); } }