亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

node.js - gm convert unable to open file ...[NO such file or directory]
typecho
typecho 2017-06-27 09:18:16
0
1
1813

Use gm to read the image, the path is correct,
Error report: gm convert unable to open file ...[NO such file or directory]

router.js

//path.join(__dirname,'../avatar/',filename)等價于
==c:\users\MrsH\Desktop\codeth\shuoshuo\router\avatar\uestcw.jpg
所以路徑是沒有問題,圖片存在可以無法讀取并修改

 gm(path.join(__dirname, '../avatar/', filename))
        .crop(w,h,x,y)
        .resize(100,100,"!")
        .write(path.join(__dirname, './avatar/', filename),function(err){
          if(err){
            console.log(err)
              res.send("-1");
              return;
          }
          res.send("1");
    });

The following is the document tree

typecho
typecho

Following the voice in heart.

reply all(1)
滿天的星座
//寫成這樣沒錯
gm(path.join(__dirname,'../models','pic08.jpg'))
    .crop(100,100,100,100)
    .resize(50,50,'!')
    .write('./a.jpg', (err)=>{
        if(err) console.log(err);
        console.log('finished');
    })
//當(dāng)我把write的路徑改為以下時,報錯
path.join(__dirname,'./models','pic08.jpg')
//改成這樣是對的
path.join(__dirname,'models','pic08.jpg')

So when path.join is used in the future, it means that files in the current directory should not be added ./

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template