You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The streaming API is similar to libpng's which is great when it comes porting code but it has some drawbacks, this issue is for listing potential improvements.
The text was updated successfully, but these errors were encountered:
The current streaming API expects the read callback to copy data to a library-controlled buffer, this introduces unnecessary copying if the user is also storing the PNG in memory.
Add a new function spng_set_png_stream2() that takes a different type of callback:
typedef int spng_read_fn2(spng_ctx *ctx, void *user, void **dest, size_t length);
This callback function assigns the pointer dest to the requested amount of bytes.
It also might be nice to allow a push-style or asynchronous decoding interface. For example, in netsurf's png handler, it receives image data in chunks, and pushes it into libpng with png_process_data:
The streaming API is similar to libpng's which is great when it comes porting code but it has some drawbacks, this issue is for listing potential improvements.
The text was updated successfully, but these errors were encountered: