Hi guyz,
I was wondering, is there a pure C++ library that handle PNG image files ?
I only find libpng and some wrappers but no C++ library.
Your comments and observation about having a C++ library for PNG files are very much appreciated.
Are you asking because you're interested in writing and publishing a PNG decoder? If so, then don't. A PNG decoder is a critical attack surface for security bugs. Consider what would happen if Firefox attempts to display a PNG file that's been crafted to take advantage of a bug in the decoder to execute arbitrary code.
libpng has already been extensively tested and there's no good reason to replace it.
Thank you helios.
And yes, that was an idea, just an idea : writing yes, publishing... not necessarily ^_^
I was aware of the security reasons but then, I'm wondering how good it is to use the library wrapped in C++... because then the library is compiled with a C++ compiler when used with C++ code.
And a lot of C standard library are weak with regard to security.
Well thank you ;)... I'll think about that and I'm posponing that for an undetermined period of time :D
I'm wondering how good it is to use the library wrapped in C++... because then the library is compiled with a C++ compiler when used with C++ code.
No, the library itself is compiled by a C compiler, even when wrapped. Unless the person who wrote the wrapper doesn't have a clue of how to interoperate with C.
And a lot of C standard library are weak with regard to security.
First, some standard C functions are not by themselves buggy, it's just that it's relatively hard to use them correctly without introducing security bugs.
Second, the fact that standard C functions are difficult to use doesn't by itself make any given C program buggier. libpng might very well be using all those functions correctly, or it might not even be using them. If you didn't check the source you can't know.
Ah ok. Thank you for the information.
I didn't know that there is a way to interoperate with C code in C++ ^_^ nor that the "C++ compiler" invoques the C compiler.