diff options
author | Christian Hesse <mail@eworm.de> | 2013-07-09 22:47:55 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-07-09 22:47:55 +0200 |
commit | af713f959f001391fd2a716ec347796015f1df4f (patch) | |
tree | f54e1c4064c6cfae51817d6f0fe552ab6078ce2d | |
parent | d0b6d52bc46a054ecff777f9ed226faca48c0551 (diff) | |
download | cqrlogo-af713f959f001391fd2a716ec347796015f1df4f.tar.gz cqrlogo-af713f959f001391fd2a716ec347796015f1df4f.tar.zst |
be more verbose about versions used
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | cqrlogo.c | 8 |
2 files changed, 8 insertions, 1 deletions
@@ -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) @@ -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 *)); |