From 5683fc63485590f6f35ed8978899e6d6a0eae4bb Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 24 Nov 2024 16:25:04 +0100 Subject: Add support to read png version --- src/dpng.h | 2 ++ src/png.c | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/dpng.h b/src/dpng.h index a9ee8820..fd5119c6 100644 --- a/src/dpng.h +++ b/src/dpng.h @@ -7,10 +7,12 @@ extern "C" { #include "url.h" #include "image.hh" +#include "cache.h" void *a_Png_new(DilloImage *Image, DilloUrl *url, int version); void a_Png_callback(int Op, CacheClient_t *Client); +const char *a_Png_version(void); #ifdef __cplusplus diff --git a/src/png.c b/src/png.c index ae3d9f82..2aedc374 100644 --- a/src/png.c +++ b/src/png.c @@ -2,6 +2,7 @@ * Copyright Geoff Lane nov 1999 zzassgl@twirl.mcc.ac.uk * Copyright Luca Rota, Jorge Arellano Cid, Eric Gaudet 2000 * Copyright Jorge Arellano Cid 2009 + * Copyright (C) 2024 Rodrigo Arias Mallo */ /** @@ -436,6 +437,11 @@ void a_Png_callback(int Op, void *data) } } +const char *a_Png_version(void) +{ + return png_get_libpng_ver(NULL); +} + /** * Create the image state data that must be kept between calls */ @@ -465,5 +471,6 @@ void *a_Png_new(DilloImage *Image, DilloUrl *url, int version) void *a_Png_new() { return 0; } void a_Png_callback() { return; } +const char *a_Png_version(void) { return NULL; } #endif /* ENABLE_PNG */ -- cgit v1.2.3