summaryrefslogtreecommitdiff
path: root/src/format/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/image')
-rw-r--r--src/format/image/png.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/format/image/png.c b/src/format/image/png.c
index 5b0c3d2..728fc23 100644
--- a/src/format/image/png.c
+++ b/src/format/image/png.c
@@ -1,3 +1,4 @@
+#include "tinyff/result.h"
#include <tinyff/common.h>
#include <tinyff/image/png.h>
@@ -479,6 +480,14 @@ ff_result ff_close_png(ff_ctx* ctx, ff_png_ctx *png_ctx)
return FF_RESULT_OK;
}
+ff_result ff_write_chunk(ff_stream *stream, const char *type, uint8_t *buf, size_t len)
+{
+ stream->write(stream, 4, type);
+ stream->write(stream, 4, (uint32_t*)&len);
+ stream->write(stream, len, buf);
+ stream->write(stream, 4, (uint32_t*)0); // TODO: Implement actual CRC calculation (use ff_write_be32)
+ return FF_RESULT_OK;
+}
ff_result ff_png_normalize(ff_ctx *ctx, ff_png_ctx *png_ctx, ff_image_ctx **out_data, ff_flag consume)
{