0

我目前正在学习编程,并且正在尝试将此库添加到ZopfliPNG。我想用它代替 Zopfli。我试图改变这个,但它不工作:

unsigned CustomPNGDeflate(unsigned char** out, size_t* outsize,
                          const unsigned char* in, size_t insize,
                          const LodePNGCompressSettings* 设置){

            int 压缩级别 = 12;

            struct libdeflate_compressor* 压缩器;

            压缩器 = libdeflate_alloc_compressor(compression_level);

            libdeflate_deflate_compress(压缩器,in,insize,out,outsize);

            libdeflate_free_compressor(压缩器);

            返回0;
}

在编译期间,我有这个:

错误:从 'size_t* {aka unsigned int*}' 到 'size_t {aka unsigned int}' 的无效转换 [-fpermissive]
  libdeflate_deflate_compress(压缩器,in,insize,out,outsize);

libdeflate.h:65:1:
注意:初始化 'size_t libdeflate_deflate_compress(libdeflate_compressor*, const void*, size_t, void*, size_t)' 的参数 5
 libdeflate_deflate_compress(结构 libdeflate_compressor *compressor,

make: *** [bin] 错误 1

也许我在这里没有做正确的事情。任何帮助将不胜感激 !

4

1 回答 1

0

outsize是 asize_t *libdeflate_deflate_compress期待 a size_t

于 2017-04-20T09:06:08.257 回答