zhangyuanwei / node-images Goto Github PK
View Code? Open in Web Editor NEWCross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
Home Page: https://npmjs.org/package/images
License: MIT License
Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
Home Page: https://npmjs.org/package/images
License: MIT License
编译出来的模块为images.node
fis-spriter-csssprites插件在加载node-images时, 实际需要 node_images_module
求大神指点怎么修改编译目标模块名.
Hello there! I absolutely love your project, it is amazing and works flawlessly. While building my desktop application I ended up needing some bindings for nwjs. I forked the repository, added my bindings, and then re-published it here: https://github.com/PopcornTV/node-images and here: https://www.npmjs.com/package/ptv-images
I saw that your License (MIT) was only in the package.json file, and as such I wanted to reach out to you to see if this was ok for me to do. If it is not then I will gladly make some pull requests and close down my branch. I just know that my users will need quite a few bindings and because of that, I felt that I could maintain my branch.
Is the statement that I added to the top of the readme enough to give proper credit back to you? Is there something else that I can do?
Let me know!
Thanks.
我使用这个模块,把我的图片都加上尺寸,发现跑了2000多张图片的时候内存暴涨,而且save之后也没发释放。请问有什么办法?
var im = images(path);
var fr = fs.readFileSync(path);
var picSize = im.size().width + "*" + im.size().height;
var fileSize = fr.length;
im = null;
fr = null;
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
以下为日志:
D:\imagestest>npm install images
npm http GET https://registry.npmjs.org/images
npm http 304 https://registry.npmjs.org/images
[email protected] install D:\imagestest\node_modules\images
node install.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:975:11)
at Process.ChildProcess._handle.onexit (child_process.js:766:34)
npm ERR! [email protected] install: node install.js
npm ERR! cmd "/c" "node install.js"
failed with 8
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls images
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "images"
npm ERR! cwd D:\imagestest
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\imagestest\npm-debug.log
npm ERR! not ok code 0
D:\imagestest>
Features 功能特性
Lightweight:no need to install any image processing library.
•轻量级:无需安装任何图像处理库。
Installation 安装$ npm install images
You will also need to install:
•giflib 4.x.x
•libpng 1.5.x
•jpeg-turbo 1.x.x
如题,谢谢。。
xxx\node_modules\images\binding.js:4
throw new Error('Can't load the addon. please try to run `node install.js
I started getting the following error:
{"level":"error","message":"on uncaughtException: Can't load the addon. please try to run `node install.js` command.,\n\nError: Can't load the addon. please try to run `node install.js` command.\n at Object.<anonymous> (D:\\home\\site\\wwwroot\\node_modules\\images\\binding.js:4:11)\n at Module._compile (module.js:460:26)\n at Object.Module._extensions..js (module.js:478:10)\n at Module.load (module.js:355:32)\n at Function.Module._load (module.js:310:12)\n at Module.require (module.js:365:17)\n at require (module.js:384:17)\n at Object.<anonymous> (D:\\home\\site\\wwwroot\\node_modules\\images\\index.js:4:15)\n at Module._compile (module.js:460:26)\n at Object.Module._extensions..js (module.js:478:10)","timestamp":"2015-02-15T09:54:39.208Z"}
图片处理之后,我不想保存到文件,而是想获取一段base64数据。
最近发现很多 Linux glibc 由于内核不同 glibc 版本匹配有误,导致已经提供的二进制包加载不起来,如果遇到此种情况,可以按照以下的方法进行编译安装;
编译方法
$ git clone https://github.com/zhangyuanwei/node-images
$ cd node-images
$ git submodule init
$ git submodule update
$ cd gyp
$ sh third-party.sh
$ cd ..
$ npm install
$ node-gyp rebuild
大概四个步骤
sh third-party.sh
来下载 gyp 用到的所有的源码包,可能会由于墙之类的下载会比较吃力,请自备梯子。另外需要 cmake
请安装它 sudo apt-get install cmake
。nan
,npm install
node-gyp rebuild
;可能你没有 node-gyp 请安装它 npm install -g node-gyp
/home/weihj/node_modules/images/index.js:45
return this._handle.toBuffer(type, config);
^
Error: ../src/Image.cc:380 Encode fail.
at WrappedImage.prototype.encode (/home/weihj/node_modules/images/index.js:45:29)
at WrappedImage. (/home/weihj/node_modules/images/index.js:89:34)
at WrappedImage.prototype.save (/home/weihj/node_modules/images/index.js:52:37)
at WrappedImage.save (/home/weihj/node_modules/images/index.js:89:34)
at DeepZoom.DumpImages (/home/weihj/DeepZoom.js:235:47)
at /home/weihj/node_modules/async/lib/async.js:249:17
at replenish (/home/weihj/node_modules/async/lib/async.js:194:21)
at /home/weihj/node_modules/async/lib/async.js:206:33
at /home/weihj/node_modules/async/lib/async.js:251:21
at DeepZoom.DumpImages (/home/weihj/DeepZoom.js:236:9)
execvp(): No such file or directory
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
git clone 后 node install.js 报错
测试代码应该有完善的用例和断言,不是写demo代码把主要功能运行一遍就ok的。
比如PNG格式的32位色转成8位色,JPG格式转成50%质量。
"C:\Program Files (x86)\JetBrains\PhpStorm 9.0.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" app.js
c:\ImageManipulationWeb_Nodejs\node_modules\images\binding.js:55
throw new Error('Can\'t load the addon. Issue to: ' + bugUrl + ' ' + e.stack);
^
Error: Can't load the addon. Issue to: https://github.com/zhangyuanwei/node-images/issues Error: %1 is not a valid Win32 application.
c:\ImageManipulationWeb_Nodejs\node_modules\images\bindings\win32\x64\4.0.0\binding.node
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous>
..........
When I try to run on 64bit nodejs environment, the exception will be thrown. But It is able to run on 32bit nodejs environment.
var img = require('images')
var image = '/path/to.jpg'
console.log(img(image).size())
/Users/tcdona/electron/electron.app/Contents/Resources/textcraft/node_modules/images/binding.js:47 Uncaught Error: Can't load the addon. Issue to: https://github.com/zhangyuanwei/node-images/issues
mac osx 10.10
..\src\Image.cc:173 Invalid argumentsArguments error
undefined
//原图
var image = images(path.join('public/upload_temp', paths[0]));
var saveTo = path.resolve(path.join('public/thumbs', path_name));
//试过好几次, 仅宽度报错, 宽度高度也报错, 源码里有个filter, 也不知道是什么类型的, 试了下字符串, 数字, 都报错...
var thumb = image.resize(w, h);
thumb.save(saveTo);
如题,图片从正常尺寸缩小为其一半的时候失真很明显,应该怎么解决呢?
我的ubuntu服务器安装的是0.12.0的nodejs,直接使用node-images启动不了,找不到.node文件。我也试过在ubuntu编译源码,错误太多过不了,请问能不能提供一个0.12.0的编译好的.node文件,或者告诉我怎么在ubuntu编译,谢谢
我现在需要在自己的node-webkit框架中使用node-images,之前在node中使用非常顺畅和好用,但是采用node-webkit中的nw-gyp进行编译的时候总是出现语法上面的错误提示,无法编译成功,所以恳请作者能够提供一份最新node-webkit框架下window系统的编译后的库。
如題
需要哪些包?有版本限制?看其他issue说需要giflib等包,这些包搜不到啊
This would be really great. Netflix is using it and I'd like to be able to do it in node also
請問可以把結果tobuffer 嗎?
我这边有填充原始RGBA数据的需求,目前只有fill接口,无法满足需求
您这个组件,github上的版本是2.1.6,而npm上的版本才到1.5.5?
Hi,
Can someone help with this.
wen using popcorntv i have this error wen open a movie
Debug: === Generating Fanart ===
Debug: === Getting Fanart ===
Debug: https://api-v2launch.trakt.tv/movies/tt0470752?extended=images
Debug: https://walter.trakt.us/images/movies/000/163/375/fanarts/original/5db1e19703.jpg
/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:21
this._handle = new _Image(width, height);
^
TypeError: undefined is not a function
at new WrappedImage (/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:21:20)
at WrappedImage (/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:14:49)
at Function.images.loadFromBuffer (/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:167:12)
at Function.images.loadFromFile (/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:159:19)
at images (/home/balves/popcorn/PopcornTV-master/node_modules/images/index.js:127:24)
at WriteStream.<anonymous> (/home/balves/popcorn/PopcornTV-master/fanartGenerator.js:27:25)
at WriteStream.emit (events.js:129:20)
at finishMaybe (_stream_writable.js:484:14)
at afterWrite (_stream_writable.js:362:3)
at onwrite (_stream_writable.js:352:7)
CXX(target) Release/obj.target/images/src/Png.o
../src/Png.cc: In function ‘ImageState decodePng(PixelArray*, ImageData*)’:
../src/Png.cc:94:18: error: ‘png_const_bytep’ was not declared in this scope
make: *** [Release/obj.target/images/src/Png.o] Error 1
make: Leaving directory `/home/travis/build/ijse/FED/node_modules/images/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/travis/.nvm/v0.8.22/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:256:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 2.6.32-042stab061.2
gyp ERR! command "node" "/home/travis/.nvm/v0.8.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/ijse/FED/node_modules/images
gyp ERR! node -v v0.8.22
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok
npm ERR! [email protected] install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls images
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-042stab061.2
npm ERR! command "/home/travis/.nvm/v0.8.22/bin/node" "/home/travis/.nvm/v0.8.22/bin/npm" "install"
npm ERR! cwd /home/travis/build/ijse/FED
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/travis/build/ijse/FED/npm-debug.log
npm ERR! not ok code 0
The command "npm install" failed and exited with 1 during install.
Hello,你好,十分感谢你提供了一个如此简单易用的图像处理包。我在使用Images时遇到了如下问题:.size()方法报错:Image uninitialized,不知道你能否给出一个比较好的解决办法,谢谢。
var images = require('images');
var targetFileName = 'image.jpg';
var img = images(targetFilename);
var w = img.width();
var h = img.height();
img.size(215, 215);
img.size(215, 215);
var w = img.width();
var h = img.height();
请问width()或height()在size()之前为什么会报错呢?
期待你的回复,谢谢~
'THIRD_PATH%': 'E:/node-images/third',
是不是从路径里查找更自然一些?
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-39-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/lonso/node_modules/images
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
这样就可以直接用来生成验证码和加文字水印了。
是否在本机编译完成后,用户机不用再编译就能使用?
用户机不需要安装xcode和gyp之类端?
Error: ../src/Image.cc:268 Unknow format
at WrappedImage.prototype.loadFromBuffer (/Users/aleksej/PhpstormProjects/node-socket-test/node_modules/images/index.js:18:22)
at WrappedImage.loadFromBuffer (/Users/aleksej/PhpstormProjects/node-socket-test/node_modules/images/index.js:89:34)
at Function.images.loadFromBuffer (/Users/aleksej/PhpstormProjects/node-socket-test/node_modules/images/index.js:159:27)
at Function.images.loadFromFile (/Users/aleksej/PhpstormProjects/node-socket-test/node_modules/images/index.js:151:19)
at images (/Users/aleksej/PhpstormProjects/node-socket-test/node_modules/images/index.js:119:24)
at repl:1:2
at REPLServer.self.eval (repl.js:110:21)
at Interface. (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
Throws at
var images = require('images')
images(PATH_TO_WORKING_JPEG_I_TRIED_MANY_OF_THEM)
Wtf?
F:\ABen鏂囦欢\project\node-ab-ccss\demo\node_modules\node-ab-ccss\node_modules\i
mages\index.js:45
return this._handle.toBuffer(type, config);
^
Error: ..\src\Image.cc:380 Encode fail.
at WrappedImage.prototype.encode (F:\ABen鏂囦欢\project\node-ab-ccss\demo\no
de_modules\node-ab-ccss\node_modules\images\index.js:45:29)
at WrappedImage.<anonymous> (F:\ABen鏂囦欢\project\node-ab-ccss\demo\node_mo
dules\node-ab-ccss\node_modules\images\index.js:89:34)
at WrappedImage.prototype.save (F:\ABen鏂囦欢\project\node-ab-ccss\demo\node
_modules\node-ab-ccss\node_modules\images\index.js:52:37)
at WrappedImage.save (F:\ABen鏂囦欢\project\node-ab-ccss\demo\node_modules\n
ode-ab-ccss\node_modules\images\index.js:89:34)
at deal4Img (F:\ABen鏂囦欢\project\node-ab-ccss\demo\node_modules\node-ab-cc
ss\abc-mod-deal4Img.js:186:17)
at process.<anonymous> (F:\ABen鏂囦欢\project\node-ab-ccss\demo\node_modules
\node-ab-ccss\index.js:137:17)
at process.EventEmitter.emit (events.js:117:20)
at handleMessage (child_process.js:318:10)
at Pipe.channel.onread (child_process.js:345:11)
暂时测试到在 window 7 下,将 jpg、png 混合生成 gif 时,出现 encode 错误,请问如何解决
你好,我试用过了,感觉挺不错的。只是图像用.size()缩小之后质量感觉不是很好,想问一下现在使用的缩放算法是什么?
使用的时候报超出图片尺寸限制,不知道为什么?
其实我的图片大小才372*661,但是其实图片已经保存成功了~
[15:58:39] Error: ../src/Image.cc:412 Beyond the pixel size limit.
at WrappedImage.prototype.loadFromBuffer (/Users/windy/application/tianma/node_modules/auto-sprites/node_modules/node-images/index.js:18:22)
at WrappedImage.aliases.(anonymous function).forEach.target.(anonymous function) as loadFromBuffer
at Function.images.loadFromBuffer (/Users/windy/application/tianma/node_modules/auto-sprites/node_modules/node-images/index.js:153:27)
at Function.images.loadFromFile (/Users/windy/application/tianma/node_modules/auto-sprites/node_modules/node-images/index.js:145:19)
安装的话就使用了npm install images。
其他安装包
giflib 4.x.x
libpng 1.5.x
jpeg-turbo 1.x.x
自己手动编译安装。。。
/node_modules/images/binding.js:55
throw new Error('Can't load the addon. Issue to: ' + bugUrl +
^
Error: Can't load the addon. Issue to: https://github.com/zhangyuanwei/node-images/issues Error: Cannot find module './bindings/linux/ia32/0.12.0/binding.node'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/home/yangqw/spider/zhihuspider/node_modules/images/binding.js:52:34)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at Object. (/home/yangqw/spider/zhihuspider/node_modules/images/binding.js:55:23)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/home/yangqw/spider/zhihuspider/node_modules/images/index.js:4:15)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
error: Forever detected script exited with code: 1
麻烦补充一下linux下的安装指导
或者想办法把依赖的几个库并在node-images下一起安装
提示绑定错误
images(http://d.hiphotos.baidu.com/image/pic/item/58ee3d6d55fbb2fb50264c994d4a20a44623dc2f.jpg)
这么写会出现异常,如下:
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory 'http://d.hiphotos.baidu.com/image/pic/item/58ee3d6d55fbb2fb50264c994d4a20a44623dc2f.jpg'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
我是一前端工程师,经常需要将一些png24图片通过tinypng.com压缩为png8以减少图片体积,找了好久也没有找到类似的功能,是否可以提供一个?我现在没有好的吧办法只能写一个程序调用那个网站的功能区压缩,但这样太慢了。
../src/Gif.cc: In function ‘ImageState decodeGif(PixelArray*, ImageData*)’:
../src/Gif.cc:82:51: error: too few arguments to function ‘GifFileType* DGifOpen(void*, InputFunc, int*)’
if((gif = DGifOpen((void *) input, ReadFromMemory)) == NULL) goto RETURN;
^
In file included from ../src/Gif.cc:11:0:
/usr/include/gif_lib.h:181:14: note: declared here
GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */
^
The DGifOpen
function provided by giflib now takes a third int *
parameter called Error
. To get the old behaviour, pass in NULL for this parameter (see this commit to Enlightenment.)
(Sorry, I don't know chinese.)
[562] > npm install
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/images
npm http 200 https://registry.npmjs.org/images
npm http GET https://registry.npmjs.org/images/-/images-1.1.3.tgz
npm http 200 https://registry.npmjs.org/images/-/images-1.1.3.tgz
[email protected] install /Users/akhoury/code/img2pdf/node_modules/images
node install.js
CXX(target) Release/obj.target/images/src/Image.o
make: c++: No such file or directory
make: *** [Release/obj.target/images/src/Image.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:786:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/akhoury/code/img2pdf/node_modules/images
gyp ERR! node -v v0.10.3
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! [email protected] install: node install.js
npm ERR! sh "-c" "node install.js"
failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls images
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/akhoury/code/img2pdf
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.17
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/akhoury/code/img2pdf/npm-debug.log
npm ERR! not ok code 0
I'm trying to build the bindings from scratch (specifically because i'd like to use node-images in an NW.js project and I need to compile a version for io.js instead of node.js). I'm running into this error when i try to run 'node-gyp build' :
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/libjpeg-turbo/gyp/third-party/libjpeg-turbo/bmp.o
In file included from ../gyp/third-party/libjpeg-turbo/bmp.c:33:
In file included from ../gyp/third-party/libjpeg-turbo/cdjpeg.h:17:
../gyp/third-party/libjpeg-turbo/jpeglib.h:67:9: error: unknown type name 'JSAMPLE'
typedef JSAMPLE JSAMPROW; / ptr to one image row of pixel samples. /
^
../gyp/third-party/libjpeg-turbo/jpeglib.h:656:3: error: unknown type name 'JSAMPLE'
JSAMPLE * sample_range_limit; / table for fast range-limiting /
^
../gyp/third-party/libjpeg-turbo/bmp.c:128:2: error: use of undeclared identifier 'JPEG_LIB_VERSION'
jpeg_create_compress(&cinfo);
^
../gyp/third-party/libjpeg-turbo/jpeglib.h:899:34: note: expanded from macro 'jpeg_create_compress'
jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION,
^
../gyp/third-party/libjpeg-turbo/bmp.c:168:17: warning: incompatible pointer types passing 'JSAMPROW' (aka 'int *') to parameter of type 'unsigned char *' [-Wincompatible-pointer-types]
pixelconvert(src->buffer[i], srcpf, 0, outbuf, dstpf, bottomup, *w,
^~~~~~~~~~~~~~
../gyp/third-party/libjpeg-turbo/bmp.c:75:41: note: passing argument to parameter 'srcbuf' here
static void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,
^
../gyp/third-party/libjpeg-turbo/bmp.c:212:2: error: use of undeclared identifier 'JPEG_LIB_VERSION'
jpeg_create_decompress(&dinfo);
^
../gyp/third-party/libjpeg-turbo/jpeglib.h:902:36: note: expanded from macro 'jpeg_create_decompress'
jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION,
^
../gyp/third-party/libjpeg-turbo/bmp.c:256:41: warning: incompatible pointer types passing 'JSAMPROW' (aka 'int *') to parameter of type 'unsigned char *' [-Wincompatible-pointer-types]
pixelconvert(inbuf, srcpf, bottomup, dst->buffer[i], dstpf, 0, w,
^~~~~~~~~~~~~~
../gyp/third-party/libjpeg-turbo/bmp.c:76:17: note: passing argument to parameter 'dstbuf' here
unsigned char *dstbuf, int dstpf, int dstbottomup, int w, int h)
^
2 warnings and 4 errors generated.
make: ** [Release/obj.target/libjpeg-turbo/gyp/third-party/libjpeg-turbo/bmp.o] Error 1
Note: I've tried running it with node-gyp and nw-gyp just to be sure it's not because of nw-gyp.
Have you ever encountered this sort of error when trying to compile libjpeg-turbo?
I'm trying to compile this for OSX v10.10.3 x64 if that helps
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.