From af713f959f001391fd2a716ec347796015f1df4f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 9 Jul 2013 22:47:55 +0200 Subject: be more verbose about versions used --- Makefile | 1 + cqrlogo.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1e3c2e2..8ea936a 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ CP := cp RM := rm CFLAGS += -O2 -Wall -Werror CFLAGS += $(shell pkg-config --cflags --libs libpng) \ + $(shell pkg-config --cflags --libs zlib) \ $(shell pkg-config --cflags --libs libqrencode) VERSION = $(shell git describe --tags --long) diff --git a/cqrlogo.c b/cqrlogo.c index a9a4a5e..52d216d 100644 --- a/cqrlogo.c +++ b/cqrlogo.c @@ -47,6 +47,11 @@ int generate_png (struct bitmap_t *bitmap, char *http_referer) { #ifdef PNG_TEXT_SUPPORTED png_text text[3]; + char *version; + const char *v_libpng = png_libpng_ver, *v_zlib = zlib_version; + + version = malloc(18 + strlen(VERSION) + strlen(v_libpng) + strlen(v_zlib)); + sprintf(version, VERSION " (libpng %s, zlib %s)", png_libpng_ver, zlib_version); text[0].compression = PNG_TEXT_COMPRESSION_zTXt; text[0].key = "comment"; @@ -54,13 +59,14 @@ int generate_png (struct bitmap_t *bitmap, char *http_referer) { text[1].compression = PNG_TEXT_COMPRESSION_zTXt; text[1].key = "version"; - text[1].text = VERSION; + text[1].text = version; text[2].compression = PNG_TEXT_COMPRESSION_zTXt; text[2].key = "referer"; text[2].text = http_referer; png_set_text(png_ptr, info_ptr, text, 3); + free(version); #endif row_pointers = png_malloc (png_ptr, bitmap->height * sizeof (png_byte *)); -- cgit v1.2.3-70-g09d2