Skip to content

Commit 45cb4e5

Browse files
committed
Try a different windows syntax
1 parent 9408e3a commit 45cb4e5

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/libImaging/ZipEncode.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,19 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
9090

9191
#ifdef HAVE_ZLIBNG
9292
err = zng_deflateInit2(
93+
&context->z_stream,
94+
/* compression level */
95+
compress_level,
96+
/* compression method */
97+
Z_DEFLATED,
98+
/* compression memory resources */
99+
15,
100+
9,
101+
/* compression strategy (image data are filtered)*/
102+
compress_type
103+
);
93104
#else
94105
err = deflateInit2(
95-
#endif
96106
&context->z_stream,
97107
/* compression level */
98108
compress_level,
@@ -104,6 +114,7 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
104114
/* compression strategy (image data are filtered)*/
105115
compress_type
106116
);
117+
#endif
107118
if (err < 0) {
108119
state->errcode = IMAGING_CODEC_CONFIG;
109120
return -1;
@@ -112,13 +123,17 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
112123
if (context->dictionary && context->dictionary_size > 0) {
113124
#ifdef HAVE_ZLIBNG
114125
err = zng_deflateSetDictionary(
126+
&context->z_stream,
127+
(unsigned char *)context->dictionary,
128+
context->dictionary_size
129+
);
115130
#else
116131
err = deflateSetDictionary(
117-
#endif
118132
&context->z_stream,
119133
(unsigned char *)context->dictionary,
120134
context->dictionary_size
121135
);
136+
#endif
122137
if (err < 0) {
123138
state->errcode = IMAGING_CODEC_CONFIG;
124139
return -1;

0 commit comments

Comments
 (0)