From 26fe9cb57de51c2afd7f7cd241538d133e41d4cf Mon Sep 17 00:00:00 2001 From: fanjiaojiao Date: Wed, 31 Aug 2022 18:04:59 +0800 Subject: [PATCH] =?UTF-8?q?lite=E5=B7=A5=E7=A8=8B=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fanjiaojiao --- ace-loader/src/lite/lite-image2bin.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ace-loader/src/lite/lite-image2bin.js b/ace-loader/src/lite/lite-image2bin.js index e530705..868e2a4 100644 --- a/ace-loader/src/lite/lite-image2bin.js +++ b/ace-loader/src/lite/lite-image2bin.js @@ -64,15 +64,12 @@ async function img2bin(imgPath) { binView.setUint8(binFileOffset, alpha, true); binFileOffset += 1; }); - if (process.env.PLATFORM_VERSION_version <=6) { - const binPath1 = imgPath.replace(/(\.png|\.jpg|\.bmp|\.jpeg|\.BMP|\.JPG|\.PNG|\.JPEG)$/, '.bin'); - fs.writeFileSync(binPath1, Buffer.from(binBuffer)); + const binPath1 = imgPath.replace(/(\.png|\.jpg|\.bmp|\.jpeg|\.BMP|\.JPG|\.PNG|\.JPEG)$/, '.bin'); + fs.writeFileSync(binPath1, Buffer.from(binBuffer)); } - const binPath2 = imgPath+".bin"; - fs.writeFileSync(binPath2, Buffer.from(binBuffer)); - - + const binPath2 = imgPath+".bin"; + fs.writeFileSync(binPath2, Buffer.from(binBuffer)); } catch (err) { const imageName = _path.basename(imgPath); console.error('\u001b[31m', `Failed to convert image ${imageName}.`, '\u001b[39m');