mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-20 21:59:23 -04:00
@@ -64,11 +64,12 @@ async function img2bin(imgPath) {
|
||||
binView.setUint8(binFileOffset, alpha, true);
|
||||
binFileOffset += 1;
|
||||
});
|
||||
const binPath1 = imgPath.replace(/(\.png|\.jpg|\.bmp|\.jpeg|\.BMP|\.JPG|\.PNG|\.JPEG)$/, '.bin');
|
||||
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 binPath2 = imgPath+".bin";
|
||||
fs.writeFileSync(binPath1, Buffer.from(binBuffer));
|
||||
fs.writeFileSync(binPath2, Buffer.from(binBuffer));
|
||||
|
||||
} catch (err) {
|
||||
const imageName = _path.basename(imgPath);
|
||||
console.error('\u001b[31m', `Failed to convert image ${imageName}.`, '\u001b[39m');
|
||||
|
||||
@@ -131,6 +131,7 @@ function setConfigs(env) {
|
||||
if (version <= 4) {
|
||||
process.env.PLATFORM_VERSION = PLATFORM.VERSION3;
|
||||
}
|
||||
process.env.PLATFORM_VERSION_VERSION = version;
|
||||
}
|
||||
|
||||
module.exports = (env) => {
|
||||
|
||||
Reference in New Issue
Block a user