summaryrefslogtreecommitdiff
path: root/src/format/image
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-01-29 20:21:19 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-01-29 20:21:19 +1100
commit3989489a3a786aeb87dbdf30d6468f7fe7438759 (patch)
treed1136675c1a5f0166220f43e68d6eac2242c0764 /src/format/image
parentf8ce98574f3f1e4f314de15be7fc66f307348618 (diff)
feat(png): Keep interlacing value in PNG context
Diffstat (limited to 'src/format/image')
-rw-r--r--src/format/image/png.c16
1 files changed, 16 insertions, 0 deletions
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;
}