zlib header detection is too restrictive.
This statement looks only for three specific possible zlib headers. There are many more valid zlib headers that would be missed. 61 to be precise. Look at RFC 1950 for the definition of a zlib header.
Thanks for the report. Bug confirmed. See also https://stackoverflow.com/questions/9050260/what-does-a-zlib-header-look-like If you have a patch, please feel free to submit a PR.
It looks like you already know to use inflateInit2() with 15+32 in order to auto-detect the format. What you're looking for is already built into zlib's inflate.
(I am not the author of the software, just an end user / collaborator with admin rights as the original author dropped the project support)