Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js NodeJs lwip.open()回调函数在从磁盘读取图像文件时返回空对象_Node.js_Image Processing_Lwip - Fatal编程技术网

Node.js NodeJs lwip.open()回调函数在从磁盘读取图像文件时返回空对象

Node.js NodeJs lwip.open()回调函数在从磁盘读取图像文件时返回空对象,node.js,image-processing,lwip,Node.js,Image Processing,Lwip,open()从磁盘读取图像时返回一个空对象 和am使用lwip版本“0.0.6” 节点代码: var lwip = require('lwip'); lwip.open('path/to/image.jpg', function(err, image){ console.log("Image :", image); }); 输出: var lwip = require('lwip'); lwip.open('path/to/image.jpg', function(err, image){

open()从磁盘读取图像时返回一个空对象 和am使用lwip版本“0.0.6”

节点代码:

var lwip = require('lwip');
lwip.open('path/to/image.jpg', function(err, image){
 console.log("Image :", image); 
});
输出:

var lwip = require('lwip');
lwip.open('path/to/image.jpg', function(err, image){
 console.log("Image :", image); 
});
图像:{{uuuulwip:{},{uuuuu锁定:false,{uuuuu trans:false}

尽管回调函数抛出一个空对象{{uuuulwip:{}、{uuuu locked:false、{uuuuutrans:false},但在完成图像处理操作后,将回调图像写入一个位置以查看图像

NodeJs示例代码:

var lwip = require('lwip');    
require('lwip').open('image.jpg', function(err, image){          
  image.batch()
    .scale(0.75)          // scale to 75%
    .rotate(45, 'white')  // rotate 45degs clockwise (white fill)
    .crop(200, 200)       // crop a 200X200 square from center
    .blur(5)              // Gaussian blur with SD=5
    .writeFile('output.jpg', function(err){
      // check err...
      // done.
    });    
});