libspng icon indicating copy to clipboard operation
libspng copied to clipboard

Simplified API

Open randy408 opened this issue 5 years ago • 3 comments

This issue tracks nice-to-have functions that can be implemented on top of existing functionality.

Decode from file

Similar to stbi_load()

int spng_decode_file(const char *filename, void **buf, struct spng_ihdr *ihdr, int fmt, int flags);

Depends on https://github.com/randy408/libspng/issues/47

This does not allow for a custom memory allocator nor context flags, which is a drawback.

randy408 avatar Dec 20 '19 17:12 randy408

out-of-scope? I would prefer not having this or at least being able to disable it with a define (I avoid dependency to crt when possible).

capr avatar Dec 24 '21 08:12 capr

File I/O is already supported through opened FILE*'s, so fread()/fwrite() makes it depend on the crt(?)

Paths are not supported at the moment because it's not as straightforward on Windows (some libraries convert the path string, some don't).

randy408 avatar Dec 24 '21 12:12 randy408

Yes, FILE is crt. I personally can't get rid of crt, but for others it might be a selling point.

capr avatar Dec 25 '21 23:12 capr