Skip to content

Commit

Permalink
uncompressed: rename ZLIB compression preprocessor define
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Jul 9, 2024
1 parent 86299ef commit 85956fb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libheif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ endif ()
if (WITH_DEFLATE_HEADER_COMPRESSION OR WITH_UNCOMPRESSED_CODEC)
find_package(ZLIB REQUIRED)
target_link_libraries(heif PRIVATE ZLIB::ZLIB)
target_compile_definitions(heif PRIVATE WITH_ZLIB_COMPRESSION=1)
target_compile_definitions(heif PRIVATE HAVE_ZLIB=1)
endif ()

if (WITH_DEFLATE_HEADER_COMPRESSION)
Expand Down
2 changes: 1 addition & 1 deletion libheif/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <error.h>

#if WITH_ZLIB_COMPRESSION
#if HAVE_ZLIB
std::vector<uint8_t> deflate(const uint8_t* input, size_t size);

Error inflate_zlib(const std::vector<uint8_t>&compressed_input, std::vector<uint8_t> *output);
Expand Down
2 changes: 1 addition & 1 deletion libheif/compression_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "compression.h"


#if WITH_ZLIB_COMPRESSION
#if HAVE_ZLIB

#include <zlib.h>
#include <cstring>
Expand Down
4 changes: 2 additions & 2 deletions libheif/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ const Error HeifFile::do_decompress_data(std::shared_ptr<Box_cmpC> &cmpC_box, st
sstr.str());
#endif
} else if (cmpC_box->get_compression_type() == fourcc("zlib")) {
#if WITH_ZLIB_COMPRESSION
#if HAVE_ZLIB
return inflate_zlib(compressed_data, data);
#else
std::stringstream sstr;
Expand All @@ -935,7 +935,7 @@ const Error HeifFile::do_decompress_data(std::shared_ptr<Box_cmpC> &cmpC_box, st
sstr.str());
#endif
} else if (cmpC_box->get_compression_type() == fourcc("defl")) {
#if WITH_ZLIB_COMPRESSION
#if HAVE_ZLIB
return inflate_deflate(compressed_data, data);
#else
std::stringstream sstr;
Expand Down

0 comments on commit 85956fb

Please sign in to comment.