lodepng
lodepng copied to clipboard
PNG encoder and decoder in C and C++.
A security researcher found that it was possible to make lodepng allocate a terabyte or more of memory by supplying bogus image dimensions. This adds a compiled-in upper limit on...
It's probably not that useful as exported API and was generating a warning when compiled as C with `-Wmissing-prototypes`. Also saves on code size when compiled without encoder/ancillary chunks. Alternately,...
https://github.com/lvandeve/lodepng/blob/b4ed2cd7ecf61d29076169b49199371456d4f90b/lodepng.cpp#L2420 r ^ 0xFFFFFFFFu is code for the 1'complement. Why not use the C/C++ 1'complement symbol '~' that the compiler could use best code implementation for used CPU?
the truely issue is that when i save a image which contain alpha value, the outputed image will be wrong without this define thanks
PNGs with 1 bit alpha are not properly loaded. They are considered RGB image and not alpha is provided. Take for example this image : https://playground.babylonjs.com/textures/pack1.png
error LNK2019: unresolved external symbol "unsigned int __cdecl error LNK2019: unresolved external symbol "char const * __cdecl error LNK2019: unresolved external symbol "unsigned int __cdecl error LNK2019: unresolved external symbol...
Compiling with -DLODEPNG_NO_COMPILE_CRC would lead to linker errors, since lodepng_crc32() was still being referenced: liblodepng.a(lodepng.o): in function `lodepng_chunk_check_crc`: lodepng.cpp:2496: undefined reference to `lodepng_crc32` liblodepng.a(lodepng.o): in function `lodepng_chunk_generate_crc`: lodepng.cpp:2503: undefined reference...
in file lodepng/examples/example_bmp2png.cpp. Line 93-97 wrong R/G/B/A order should be : image[newpos + 0] = bmp[bmpos + 2]; image[newpos + 1] = bmp[bmpos + 1]; image[newpos + 2] = bmp[bmpos...
[In `readChunk_iTXt`](https://github.com/lvandeve/lodepng/blob/5601b8272a6850b7c5d693dd0c0e16da50be8d8d/lodepng.cpp#L4615): ```c error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)(data + begin), length); ``` `data` is a `const char*`. It happens that `lodepng_add_itext_sized` takes a `const char* str`, so this...
Fixed some warnings that occur when compiling with Microsoft's compiler, especially in 64-bit mode. As a side effect, this also makes the use of `unsigned` vs. `size_t` slightly more logical...