4 ms·
That's a good point. The thing is that I've used a ready-to-use GZIP library (miniz) for building my API on top of it. I agree some parts of miniz are not neces
by wkoszek 11y ago
That's a good point. The thing is that I've used a ready-to-use GZIP library (miniz) for building my API on top of it. I agree some parts of miniz are not necessary. I will put a note in my repo to point out your links.
- byuu 11y agoSorry if I come off a bit crass. What you have is still a major improvement over people dumping all of projects like zlib and libpng in just to load in files. It's just that code complexity is probably my biggest pet peeve in programming. People often underestimate what a boon it is to avoid library dependencies. I've had so many code contributions from Windows people because all it takes to build any of my software is: "run the TDM/GCC installer, then run mingw32-make" ... the Linux/BSD mindset of "just apt-get/pkg install the dev library" doesn't work on the platform that most users and developers are on, sadly. Whereas even I usually give up trying to build OSS that has a Windows port with a dozen dependencies. So keep up the good work, and don't be afraid to gut some of those excess, unused functions in your own project :D
- wkoszek 11y agoNo worries. I like a direct feedback I get from HN readers and don't take it personally. Honestly I haven't analyzed miniz in detail: I found it was one of the choices, so I looked around and used it. Keeping stuff simple is very important, and it's unclear to me why they introduced anything with PNGs there. I may indeed decide to clean/replace it with something simpler.
- mmozeiko 11y agoIf you are after small code, you can take zlib decode functionality from stb_image.h code (public domain): https://github.com/nothings/stb/blob/master/stb_image.h#L3450 https://github.com/nothings/stb/blob/master/stb_image.h#L345...
- oso2k 11y agoYou can find the original miniz [0] on github, btw. Other small and/or fast lz* decoders are tinfl [1], stateless lz [2][3], lz4 (my favorite) [4], fastlz [5]. [0] https://github.com/richgel999/miniz https://github.com/richgel999/miniz [1] https://github.com/richgel999/miniz/blob/master/tinfl.c https://github.com/richgel999/miniz/blob/master/tinfl.c [2] https://github.com/haproxy/libslz https://github.com/haproxy/libslz [3] http://1wt.eu/projects/libslz/ http://1wt.eu/projects/libslz/ [4] https://github.com/Cyan4973/lz4 https://github.com/Cyan4973/lz4 [5] https://code.google.com/p/fastlz/ https://code.google.com/p/fastlz/