From 9fdf417c0351bc910e2dd41ae17344f7f7d4c172 Mon Sep 17 00:00:00 2001 From: WMJ Date: Sat, 4 Jun 2022 17:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=8D=20=E4=BF=AE=E5=A4=8D=20JBIG2=20?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=99=A8=E7=9A=84=E5=AF=BC=E5=87=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20(fixed=20#110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Processor/Imaging/JBig2Encoder.cs | 2 -- JBig2/src/jbig2enc.lossless.cc | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/App/Processor/Imaging/JBig2Encoder.cs b/App/Processor/Imaging/JBig2Encoder.cs index 00953eb..e5ff4c9 100644 --- a/App/Processor/Imaging/JBig2Encoder.cs +++ b/App/Processor/Imaging/JBig2Encoder.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Runtime.InteropServices; -using System.Text; using FreeImageAPI; namespace PDFPatcher.Processor.Imaging diff --git a/JBig2/src/jbig2enc.lossless.cc b/JBig2/src/jbig2enc.lossless.cc index 6aaa1f9..cf55373 100644 --- a/JBig2/src/jbig2enc.lossless.cc +++ b/JBig2/src/jbig2enc.lossless.cc @@ -195,10 +195,10 @@ jbig2_encode_generic(struct Pix *const bw, const bool full_headers, const int xr // see comments in .h file u8 * -jbig2_encode (int width, int height, int stride, bool zeroIsWhite, uint32_t * const source, int *const length) { +jbig2_encode (int width, int height, int stride, bool zeroIsWhite, uint8_t * const source, int *const length) { u8 * ret; u32 mask = zeroIsWhite ? 0x0 : 0xffffffff; - u8* pl = (u8*)source; + u8* pl = source; u8* p; u32* pw; char a, b; @@ -224,7 +224,7 @@ jbig2_encode (int width, int height, int stride, bool zeroIsWhite, uint32_t * co Pix * pix = (Pix*)malloc(sizeof(Pix)); pix->w = width; pix->h = height; - pix->data = source; + pix->data = (u32*)source; ret = jbig2_encode_generic (pix, false, 0, 0, false, length); free(pix); return ret;