2016-12-16 91 views
1

有无问题,当尝试使用LWIP调整 它的功能LWIP错误:未知参数配置

function resize(path, width, height) { 
lwip.open(path, function(err, image){ 
    console.log(image) 
    console.log(path) 
    console.error(err) 
    image.resize(width, height) 
})} 

resize("/home/peter/webstorm/testProject/public/upload/image.png", 150, 150); 

控制台日志:

图片{ __lwip:LwipImage {}, __locked:假的, __trans :假的, __metadata:空}

/home/peter/webstorm/testProject/public/upload/image.png

错误是:

错误:未知的参数配置,150,150

回答

0

你错过了争执,widthcallback是必需的,所以你就必须做到以下几点:

image.resize(width, height, function(err,image){ 
    if(err){ 
    throw(err) 
    } 
}) 

lwip#resize