randy408 / libspng

Simple, modern libpng alternative
https://libspng.org
BSD 2-Clause "Simplified" License
736 stars 74 forks source link

Simplified API #46

Open randy408 opened 4 years ago

randy408 commented 4 years ago

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.

capr commented 2 years ago

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).

randy408 commented 2 years ago

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).

capr commented 2 years ago

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