From eb91d4c38cb76dbccb16f81b66d4151628d9dad3 Mon Sep 17 00:00:00 2001 From: Victor Forsiuk Date: Thu, 19 Dec 2024 23:40:18 +0200 Subject: [PATCH] Explain the purpose of introducing dt_imageio_png_read_header and dt_imageio_png_read_image --- src/imageio/imageio_png.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/imageio/imageio_png.c b/src/imageio/imageio_png.c index 3f6b71e31391..e8e12969ccf4 100644 --- a/src/imageio/imageio_png.c +++ b/src/imageio/imageio_png.c @@ -31,6 +31,12 @@ #include "imageio_common.h" #include "imageio_png.h" + +// Reading of PNG files also takes place in the LUT 3D module in order to obtain +// LUTs encoded in this format. To minimize code duplication, we put the code +// common to both uses (reading the header and reading the image itself) into +// two functions, dt_imageio_png_read_header and dt_imageio_png_read_image. + gboolean dt_imageio_png_read_header(const char *filename, dt_imageio_png_t *png) { png->f = g_fopen(filename, "rb");