lite关于图片编译的相关优化

Signed-off-by: fanjiaojiao <fanjiaojiao@huawei.com>
This commit is contained in:
fanjiaojiao
2022-09-01 10:00:35 +08:00
parent 02d49fba85
commit e1c95de56c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ async function img2bin(imgPath) {
const binSize = HEAD_SIZE + DATA_SIZE;
const binBuffer = new ArrayBuffer(binSize);
const binView = new DataView(binBuffer);
const COLOR_MODE = 1 << 8 + 0;
const WIDTH_BIT_OFFSET = 0;
const HEIGHT_BIT_OFFSET = 16;
@@ -64,7 +64,7 @@ async function img2bin(imgPath) {
binView.setUint8(binFileOffset, alpha, true);
binFileOffset += 1;
});
if (process.env.PLATFORM_VERSION_version <=6) {
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));
}
+1 -1
View File
@@ -131,7 +131,7 @@ function setConfigs(env) {
if (version <= 4) {
process.env.PLATFORM_VERSION = PLATFORM.VERSION3;
}
process.env.PLATFORM_VERSION_version = version;
process.env.PLATFORM_VERSION_VERSION = version;
}
module.exports = (env) => {