mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-08 10:45:04 +02:00
Merge branch 'master' into version/3
This commit is contained in:
commit
0c25a8a45f
6
vips.c
6
vips.c
@ -1,6 +1,5 @@
|
||||
#include "vips.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define VIPS_SUPPORT_ARRAY_HEADERS \
|
||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 9))
|
||||
@ -539,7 +538,10 @@ vips_pngsave_go(VipsImage *in, void **buf, size_t *len, int interlace, int quant
|
||||
NULL
|
||||
);
|
||||
|
||||
int bitdepth = ceil(log2(colors));
|
||||
int bitdepth = 1;
|
||||
if (colors > 16) bitdepth = 8;
|
||||
else if (colors > 4) bitdepth = 4;
|
||||
else if (colors > 2) bitdepth = 2;
|
||||
|
||||
return vips_pngsave_buffer(
|
||||
in, buf, len,
|
||||
|
Loading…
Reference in New Issue
Block a user