compress using the default or custom zlib function */
| 2291 | |
| 2292 | /* compress using the default or custom zlib function */ |
| 2293 | static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, |
| 2294 | size_t insize, const LodePNGCompressSettings* settings) { |
| 2295 | if(settings->custom_zlib) { |
| 2296 | unsigned error = settings->custom_zlib(out, outsize, in, insize, settings); |
| 2297 | /*the custom zlib is allowed to have its own error codes, however, we translate it to code 111*/ |
| 2298 | return error ? 111 : 0; |
| 2299 | } else { |
| 2300 | return lodepng_zlib_compress(out, outsize, in, insize, settings); |
| 2301 | } |
| 2302 | } |
| 2303 | |
| 2304 | #endif /*LODEPNG_COMPILE_ENCODER*/ |
| 2305 |
no test coverage detected