From 3989489a3a786aeb87dbdf30d6468f7fe7438759 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Thu, 29 Jan 2026 20:21:19 +1100 Subject: feat(png): Keep interlacing value in PNG context --- src/format/image/png.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/format') diff --git a/src/format/image/png.c b/src/format/image/png.c index f21b42b..3fd14d5 100644 --- a/src/format/image/png.c +++ b/src/format/image/png.c @@ -92,6 +92,7 @@ ff_result ff_png_header_handler(uint8_t *buf, size_t len, ff_png_ctx *ctx) ctx->height = h; ctx->bit_depth = buf[8]; ctx->color_type = buf[9]; + ctx->interlace_method = buf[12]; ff_dprintf("png: IHDR stored in context\n"); @@ -148,6 +149,21 @@ ff_result ff_png_data_handler(uint8_t *buf, size_t len, ff_png_ctx *ctx) return FF_RESULT_ERROR_DECOMPRESSION_FAILURE; } + ff_dprintf("png: IDAT data uncompressed successfully\n"); + + // Now we parse the uncompressed data into our pixel buffer + // However I don't understand Adam7 so interlaced images are not supported yet + if (ctx->interlace_method != 0) { + ff_dprintf("png: interlaced images are not supported yet\n"); + free(uncompressed_data); + return FF_RESULT_WARN_NO_IMPL; + } + + // Now I am very inexperienced so I'm doing what I think is right + // TODO: Review this code later + + + return FF_RESULT_WARN_NO_IMPL; } -- cgit v1.2.3