Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Commit 809300d

Browse files
committed
修复bug。
1 parent 062d732 commit 809300d

4 files changed

Lines changed: 0 additions & 43 deletions

File tree

ext/built-in/textweb/src/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,6 @@ export class application extends extType.application.base {
474474
} catch (e) {
475475
console.log('[picProcessServer] picProcessServerError', e);
476476
try {
477-
<<<<<<< HEAD
478-
=======
479-
res.writeHead(200, 'OK', { 'content-type': 'image/png', 'content-length': `${picLoadFailTip.length}` });
480-
res.write(picLoadFailTip);
481-
>>>>>>> 5220509 (init.)
482477
res.end();
483478
} catch (ee) { }
484479
}

ext/built-in/textweb/src/libPic.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ import * as fs from "node:fs";
99
async function ffmpegDecodeToPng(data,extname){
1010
return new Promise((resolve,reject)=>{
1111
var fn = sharedLib.random.randomUUID();
12-
<<<<<<< HEAD
1312
fs.writeFileSync(`/ydpsys/tmp/${fn}.${extname}`,data);
1413
var ffmpeg = childProcess.spawn('chroot',['.','ffmpeg','-i',`/tmp/${fn}.${extname}`,`/tmp/${fn}.png`],{cwd:'/ydpsys'});
15-
=======
16-
fs.writeFileSync(`${process.env['ydpSysRootPath']}/tmp/${fn}.${extname}`,data);
17-
var ffmpeg = childProcess.spawn('chroot',['.','ffmpeg','-i',`/tmp/${fn}.${extname}`,`/tmp/${fn}.png`],{cwd:`${process.env['ydpSysRootPath']}`});
18-
>>>>>>> 5220509 (init.)
1914
var outTxt = '';
2015
ffmpeg.stdout.on('data',(d)=>{
2116
outTxt += String(d);
@@ -29,23 +24,13 @@ async function ffmpegDecodeToPng(data,extname){
2924
}else{
3025
console.log('[libPic] ffmpeg exit with code',code,'. ');
3126
}
32-
<<<<<<< HEAD
3327
if (!fs.existsSync(`/ydpsys/tmp/${fn}.png`)){
3428
reject(outTxt);
3529
return;
3630
}
3731
var res = fs.readFileSync(`/ydpsys/tmp/${fn}.png`);
3832
fs.unlinkSync(`/ydpsys/tmp/${fn}.png`);
3933
fs.unlinkSync(`/ydpsys/tmp/${fn}.${extname}`);
40-
=======
41-
if (!fs.existsSync(`${process.env['ydpSysRootPath']}/tmp/${fn}.png`)){
42-
reject(outTxt);
43-
return;
44-
}
45-
var res = fs.readFileSync(`${process.env['ydpSysRootPath']}/tmp/${fn}.png`);
46-
fs.unlinkSync(`${process.env['ydpSysRootPath']}/tmp/${fn}.png`);
47-
fs.unlinkSync(`${process.env['ydpSysRootPath']}/tmp/${fn}.${extname}`);
48-
>>>>>>> 5220509 (init.)
4934
resolve(res);
5035
});
5136
});
@@ -154,10 +139,6 @@ export async function processPic(path) {
154139
data = await ffmpegDecodeToPng(data,'pic');
155140
img = await imageJs.Image.load(data);
156141
}catch(ee){
157-
<<<<<<< HEAD
158-
=======
159-
console.log('[libPic] try ffmpeg failed. \n',ee);
160-
>>>>>>> 5220509 (init.)
161142
return {
162143
type: 'text/plain',
163144
buff:Buffer.from(`${url}\n${JSON.stringify(opt)}\n${ee}`)
@@ -191,11 +172,7 @@ export async function processPic(path) {
191172
type: 'image/png'
192173
};
193174
}
194-
<<<<<<< HEAD
195175
export async function process(Url, nowUrl, processServerHost, opt,svgOpt) {
196-
=======
197-
export async function processLagacy(Url, nowUrl, processServerHost, opt,svgOpt) {
198-
>>>>>>> 5220509 (init.)
199176
return new Promise((resolve, reject) => {
200177
try {
201178
/*

ext/built-in/textweb/src/sharedLib.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ export async function lagacyProcess(input, processServerHost) {
214214
break;
215215
}
216216
case 'pic': {
217-
<<<<<<< HEAD
218217
let o = await pic.process(c.data, input.url, processServerHost, input.opt,input.svgOpt);
219-
=======
220-
let o = await pic.processLagacy(c.data, input.url, processServerHost, input.opt,input.svgOpt);
221-
>>>>>>> 5220509 (init.)
222218
if (!pics.includes(o[0].data)) pics.push(o[0].data);
223219
out = out.concat(o);
224220
break;

ext/example/async/index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,11 @@ export async function input(session,msg,update,done,isAlive,hold){
6363
}
6464

6565
export async function switchIn(session,cb){
66-
<<<<<<< HEAD
6766
return new Promise(async (resolve,reject)=>{
6867
await fadeIn(`this input event used \`Promise\`.`,fadeTime,update,0,2048,[]);
6968
setTimeout(async ()=>{
7069
await fadeOut(`this input event used \`Promise\`.`,fadeTime,update,0,2048,[]);
7170
await fadeIn(helpInfo,fadeTime,update,0,2048,recommendRes);
72-
=======
73-
const f = (txt,nowNum,maxNum,suggestedResponse)=>{
74-
cb(txt,suggestedResponse,nowNum,maxNum);
75-
};
76-
return new Promise(async (resolve,reject)=>{
77-
await fadeIn(`this input event used \`Promise\`.`,fadeTime,f,0,2048,[]);
78-
setTimeout(async ()=>{
79-
await fadeOut(`this input event used \`Promise\`.`,fadeTime,f,0,2048,[]);
80-
await fadeIn(helpInfo,fadeTime,f,0,2048,recommendRes);
81-
>>>>>>> 5220509 (init.)
8271
resolve();
8372
},3000);
8473
});

0 commit comments

Comments
 (0)