Firebase ImageMagick转换:无法读取字体

时间:2019-06-04 14:40:08

标签: firebase imagemagick google-cloud-functions

当我尝试运行此命令时,在云功能中收到以下错误,并且我不确定为什么未检测到字体,因为我没有指定字体,因此应使用默认系统字体。

args[0] = myImagePath;
args.push('-gravity', 'center','-fill','red','-annotate',`+${text_below_x}+${text_below_y}`, 'TEST MAN');
args.push('\\(',pinPath, '-resize', pinSize, '\\)', '-gravity', 'Center', '-geometry', `+${xOffset}+${yOffset}`, '-composite');
args.push(outPutPath);

var promise = spawn('convert', args, {shell: true});
promise.childProcess.stdout.on('data', data => {
    console.log('[spawn] stdout:', data.toString());
})
promise.childProcess.stderr.on('data', data => {
    console.error(data.toString()); 
    reject(data.toString())
})

错误:

  

转换:无法读取字体`(null)'@   错误/annotate.c/RenderFreetype/1127。

定义字体后错误仍然存​​在:

  

转换:无法读取字体'Arial'@   warning / annotate.c / RenderType / 872。转换:无法读取字体   “ Arial” @ error / annotate.c / RenderFreetype / 1127。

0 个答案:

没有答案