Open alevesely opened 1 year ago
For progressive image encoding you have to initialize with spng_encode_image(ctx, NULL, 0, SPNG_FMT_PNG, SPNG_ENCODE_PROGRESSIVE);
as described in the Progressive image encoding section.
I should probably do some extra error checking for this and return SPNG_EOPSTATE
("invalid operation for state") or something.
I'm unable to create an image from computed values.
For example (skipping error checks):
This prints "spng_encode_scanline() error: invalid buffer size" at line 4689 in spng.c as it checks
len < (ctx->subimage[ctx->row_info.pass].scanline_width -1)
;scanline_width
is 0, and subtracting 1 overflows.If instead I call
spng_encode_row()
it prints "internal error", from line 4574 in spng.c, after it findsscanline_width
to be 0.