diff options
Diffstat (limited to '0001-fix-compile-with-openjp25.patch')
-rw-r--r-- | 0001-fix-compile-with-openjp25.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/0001-fix-compile-with-openjp25.patch b/0001-fix-compile-with-openjp25.patch new file mode 100644 index 000000000000..1cc8768962b3 --- /dev/null +++ b/0001-fix-compile-with-openjp25.patch @@ -0,0 +1,26 @@ +--- a/src/j2k_transcode.cc 2022-05-17 10:07:44.525679224 +0200 ++++ b/src/j2k_transcode.cc 2022-05-17 10:04:18.846330309 +0200 +@@ -46,7 +46,7 @@ + #include <openjpeg.h> + #include <cmath> + #include <iostream> +- ++#include <string> + + using std::min; + using std::pow; +@@ -315,10 +315,13 @@ + parameters.max_comp_size = parameters.max_cs_size / 1.25; + parameters.tcp_numlayers = 1; + parameters.tcp_mct = 1; +- parameters.numgbits = fourk ? 2 : 1; ++ string numgbits = "GUARD_BITS="; ++ numgbits.append(std::to_string(fourk ? 2 : 1)); ++ const char* extraopt[] { numgbits.data(), nullptr }; + + /* Setup the encoder parameters using the current image and user parameters */ + opj_setup_encoder (encoder, ¶meters, xyz->opj_image()); ++ opj_encoder_set_extra_options(encoder, extraopt); + + auto stream = opj_stream_default_create (OPJ_FALSE); + if (!stream) { |