Hi guys,
Need help from someone that is awesome at code. Even good at code will do
What's needed: Titles and Previews images are getting insanely plentiful. It would be nice if they could reside in a .zip file instead of a directory of 12000 titles and directory of 12000 preview images (.png)
Problem is, by default Libpng only loads png files from a file handle.
We need to be able to load a png file from a memory buffer. In FBN source, see src/burner/image.cpp.
Google: libpng load from memory
Warning: it's a bit complex
we need a memory analog of the following functions - replacing "FILE *fp" with "UINT8 *buffer, INT32 buffersize"
INT32 PNGLoad(IMAGE* img, FILE* fp, INT32 nPreset);
INT32 PNGGetInfo(IMAGE* img, FILE *fp);
and
bool PNGIsImage(FILE* fp);
example prototypes:
INT32 PNGLoad(IMAGE* img, UINT8 *buffer, INT32 buffersize, INT32 nPreset);
INT32 PNGGetInfo(IMAGE* img, UINT8 *buffer, INT32 buffersize);
bool PNGIsImage(UINT8 *buffer, INT32 buffersize);
buffer points to png data memory blob, buffersize is png data size.
With this, I'd be happy to hook up the rest - unless you'd like to also
p.s. temp file route is
NOT an option
p.p.s: google: libpng load from memory
best regards,
- dink