This commit is contained in:
paulharris 2015-05-26 07:14:26 +00:00
commit 06982a1836
4 changed files with 29 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.*.sw?

View File

@ -62,3 +62,15 @@ add_executable(example6 ${EXAMPLE6_SRC_LIST})
target_link_libraries(example6 m) target_link_libraries(example6 m)
add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST}) add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST})
# Allow user to 'make install' into the build dir,
# so that library user can add to the -I include path:
# INSTALLDIR / include
# and then they can include miniz like so:
# #include <miniz/miniz.c>
#
# Also allows for future option to customise the generated
# files via cmake (ie can control the #define options via
# cmake OS detection routines).
#
install(FILES miniz.c tinfl.c DESTINATION include/miniz)

15
README.md Normal file
View File

@ -0,0 +1,15 @@
miniz
=====
Patches on top of the original svn repo.
https://code.google.com/p/miniz/
svn checkout http://miniz.googlecode.com/svn/trunk/ miniz-read-only
This git repo also includes all the upstream SVN checkins too.
I have:
* Rearranged the file structure to make it easier to #include into my project,
* Added a CMake build (just for the examples, but could also be used to build it as a library),
* Fix various compiler warnings (GCC, and later will fix for MSVC 2010).

View File

@ -2810,7 +2810,7 @@ void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int
for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf); for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf);
// compress image data // compress image data
tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER); tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8*)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); } for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8 const*)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); }
if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; }
// write real header // write real header
*pLen_out = out_buf.m_size-41; *pLen_out = out_buf.m_size-41;