├── .gitignore ├── LICENSE ├── README.md ├── package.json └── src ├── index.js ├── libcairo.so.2 ├── libgif.so.7 ├── libjpeg.so.8 ├── libpixman-1.so.0 ├── libpng16.so.16 └── node_modules └── canvas ├── .npmignore ├── .travis.yml ├── History.md ├── Readme.md ├── binding.gyp ├── build ├── Makefile ├── Release │ ├── .deps │ │ └── Release │ │ │ ├── canvas-postbuild.node.d │ │ │ ├── canvas.node.d │ │ │ └── obj.target │ │ │ ├── canvas-postbuild.node.d │ │ │ ├── canvas.node.d │ │ │ └── canvas │ │ │ └── src │ │ │ ├── Canvas.o.d │ │ │ ├── CanvasGradient.o.d │ │ │ ├── CanvasPattern.o.d │ │ │ ├── CanvasRenderingContext2d.o.d │ │ │ ├── FontFace.o.d │ │ │ ├── Image.o.d │ │ │ ├── ImageData.o.d │ │ │ ├── color.o.d │ │ │ └── init.o.d │ ├── canvas-postbuild.node │ ├── canvas.node │ ├── linker.lock │ └── obj.target │ │ ├── canvas-postbuild.node │ │ ├── canvas.node │ │ └── canvas │ │ └── src │ │ ├── Canvas.o │ │ ├── CanvasGradient.o │ │ ├── CanvasPattern.o │ │ ├── CanvasRenderingContext2d.o │ │ ├── FontFace.o │ │ ├── Image.o │ │ ├── ImageData.o │ │ ├── color.o │ │ └── init.o ├── binding.Makefile ├── canvas-postbuild.target.mk ├── canvas.target.mk └── config.gypi ├── index.js ├── lib ├── bindings.js ├── canvas.js ├── context2d.js ├── image.js ├── jpegstream.js └── pngstream.js ├── node_modules └── nan │ ├── .dntrc │ ├── CHANGELOG.md │ ├── LICENSE.md │ ├── README.md │ ├── appveyor.yml │ ├── doc │ ├── .build.sh │ ├── asyncworker.md │ ├── buffers.md │ ├── callback.md │ ├── converters.md │ ├── errors.md │ ├── maybe_types.md │ ├── methods.md │ ├── new.md │ ├── node_misc.md │ ├── object_wrappers.md │ ├── persistent.md │ ├── scopes.md │ ├── script.md │ ├── string_bytes.md │ ├── v8_internals.md │ └── v8_misc.md │ ├── include_dirs.js │ ├── nan.h │ ├── nan_callbacks.h │ ├── nan_callbacks_12_inl.h │ ├── nan_callbacks_pre_12_inl.h │ ├── nan_converters.h │ ├── nan_converters_43_inl.h │ ├── nan_converters_pre_43_inl.h │ ├── nan_implementation_12_inl.h │ ├── nan_implementation_pre_12_inl.h │ ├── nan_maybe_43_inl.h │ ├── nan_maybe_pre_43_inl.h │ ├── nan_new.h │ ├── nan_object_wrap.h │ ├── nan_persistent_12_inl.h │ ├── nan_persistent_pre_12_inl.h │ ├── nan_string_bytes.h │ ├── nan_typedarray_contents.h │ ├── nan_weak.h │ ├── package.json │ └── tools │ ├── 1to2.js │ ├── README.md │ └── package.json ├── package.json ├── src ├── Canvas.cc ├── Canvas.h ├── CanvasGradient.cc ├── CanvasGradient.h ├── CanvasPattern.cc ├── CanvasPattern.h ├── CanvasRenderingContext2d.cc ├── CanvasRenderingContext2d.h ├── FontFace.cc ├── FontFace.h ├── Image.cc ├── Image.h ├── ImageData.cc ├── ImageData.h ├── JPEGStream.h ├── PNG.h ├── Point.h ├── closure.h ├── color.cc ├── color.h └── init.cc └── util └── has_lib.sh /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2016 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Node Canvas Lambda Dependencies 2 | 3 | Node Canvas AWS Lambda dependencies i.e. compiled shared object files for Cairo, Pixman, libpng, libjpeg etc. 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-canvas-lambda-deps", 3 | "version": "1.2.0", 4 | "description": "Node Canvas AWS Lambda dependencies i.e. compiled shared object files for Cairo, Pixman, libpng, libjpeg etc.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/bbc/node-canvas-lambda-deps.git" 12 | }, 13 | "keywords": [ 14 | "canvas", 15 | "node-canvas", 16 | "aws", 17 | "lambda", 18 | "cairo", 19 | "shared", 20 | "objects" 21 | ], 22 | "author": "Will Bamford", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/bbc/node-canvas-lambda-deps/issues" 26 | }, 27 | "homepage": "https://github.com/bbc/node-canvas-lambda-deps#readme" 28 | } 29 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | var Canvas = require('canvas'); 2 | 3 | exports.handler = function(event, context) { 4 | 5 | var canvas = new Canvas(); 6 | canvas.width = 100; 7 | canvas.height = 100; 8 | 9 | var g = canvas.getContext('2d'); 10 | g.fillStyle = 'red'; 11 | g.fillRect(0, 0, 50, 50); 12 | g.fillStyle = 'green'; 13 | g.fillRect(50, 0, 50, 50); 14 | g.fillStyle = 'blue'; 15 | g.fillRect(0, 50, 50, 50); 16 | g.fillStyle = 'yellow'; 17 | g.fillRect(50, 50, 50, 50); 18 | 19 | console.log(canvas.toDataURL()); 20 | 21 | context.succeed('Done!'); 22 | }; 23 | -------------------------------------------------------------------------------- /src/libcairo.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/src/libcairo.so.2 -------------------------------------------------------------------------------- /src/libgif.so.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/src/libgif.so.7 -------------------------------------------------------------------------------- /src/libjpeg.so.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/src/libjpeg.so.8 -------------------------------------------------------------------------------- /src/libpixman-1.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/src/libpixman-1.so.0 -------------------------------------------------------------------------------- /src/libpng16.so.16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbc/node-canvas-lambda-deps/e54874db9ec52c7910f586afe45fd63013abf3da/src/libpng16.so.16 -------------------------------------------------------------------------------- /src/node_modules/canvas/.npmignore: -------------------------------------------------------------------------------- 1 | testing 2 | benchmarks 3 | examples 4 | support 5 | test 6 | -------------------------------------------------------------------------------- /src/node_modules/canvas/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | - "0.12" 6 | - "iojs-v1.8.4" 7 | - "iojs-v2.5.0" 8 | - "iojs-v3.3.0" 9 | - "4" 10 | - "5" 11 | matrix: 12 | allow_failures: 13 | - node_js: "5" 14 | addons: 15 | apt: 16 | sources: 17 | - ubuntu-toolchain-r-test 18 | packages: 19 | - libcairo2-dev 20 | - libjpeg8-dev 21 | - libpango1.0-dev 22 | - libgif-dev 23 | - g++-4.8 24 | env: 25 | - CXX=g++-4.8 26 | before_install: 27 | - if [[ $TRAVIS_NODE_VERSION == 0.8 ]]; then npm install -g npm@1.4.28; fi 28 | - npm explore npm -g -- npm install node-gyp@latest 29 | after_script: 30 | - npm run benchmark 31 | sudo: false 32 | -------------------------------------------------------------------------------- /src/node_modules/canvas/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'conditions': [ 3 | ['OS=="win"', { 4 | 'variables': { 5 | 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle 6 | 'with_jpeg%': 'false', 7 | 'with_gif%': 'false', 8 | 'with_pango%': 'false', 9 | 'with_freetype%': 'false' 10 | } 11 | }, { # 'OS!="win"' 12 | 'variables': { 13 | 'with_jpeg%': ' 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var canvas = require('./bindings') 13 | , Canvas = canvas.Canvas 14 | , Image = canvas.Image 15 | , cairoVersion = canvas.cairoVersion 16 | , Context2d = require('./context2d') 17 | , PNGStream = require('./pngstream') 18 | , JPEGStream = require('./jpegstream') 19 | , FontFace = canvas.FontFace 20 | , fs = require('fs') 21 | , packageJson = require("../package.json") 22 | , FORMATS = ['image/png', 'image/jpeg']; 23 | 24 | /** 25 | * Export `Canvas` as the module. 26 | */ 27 | 28 | var Canvas = exports = module.exports = Canvas; 29 | 30 | /** 31 | * Library version. 32 | */ 33 | 34 | exports.version = packageJson.version; 35 | 36 | /** 37 | * Cairo version. 38 | */ 39 | 40 | exports.cairoVersion = cairoVersion; 41 | 42 | /** 43 | * jpeglib version. 44 | */ 45 | 46 | if (canvas.jpegVersion) { 47 | exports.jpegVersion = canvas.jpegVersion; 48 | } 49 | 50 | /** 51 | * gif_lib version. 52 | */ 53 | 54 | if (canvas.gifVersion) { 55 | exports.gifVersion = canvas.gifVersion.replace(/[^.\d]/g, ''); 56 | } 57 | 58 | /** 59 | * Expose constructors. 60 | */ 61 | 62 | exports.Context2d = Context2d; 63 | exports.PNGStream = PNGStream; 64 | exports.JPEGStream = JPEGStream; 65 | exports.Image = Image; 66 | exports.ImageData = canvas.ImageData; 67 | 68 | if (FontFace) { 69 | function Font(name, path, idx) { 70 | this.name = name; 71 | this._faces = {}; 72 | 73 | this.addFace(path, 'normal', 'normal', idx); 74 | }; 75 | 76 | Font.prototype.addFace = function(path, weight, style, idx) { 77 | style = style || 'normal'; 78 | weight = weight || 'normal'; 79 | 80 | var face = new FontFace(path, idx || 0); 81 | this._faces[weight + '-' + style] = face; 82 | }; 83 | 84 | Font.prototype.getFace = function(weightStyle) { 85 | return this._faces[weightStyle] || this._faces['normal-normal']; 86 | }; 87 | 88 | exports.Font = Font; 89 | } 90 | 91 | /** 92 | * Context2d implementation. 93 | */ 94 | 95 | require('./context2d'); 96 | 97 | /** 98 | * Image implementation. 99 | */ 100 | 101 | require('./image'); 102 | 103 | /** 104 | * Inspect canvas. 105 | * 106 | * @return {String} 107 | * @api public 108 | */ 109 | 110 | Canvas.prototype.inspect = function(){ 111 | return '[Canvas ' + this.width + 'x' + this.height + ']'; 112 | }; 113 | 114 | /** 115 | * Get a context object. 116 | * 117 | * @param {String} contextId 118 | * @return {Context2d} 119 | * @api public 120 | */ 121 | 122 | Canvas.prototype.getContext = function(contextId){ 123 | if ('2d' == contextId) { 124 | var ctx = this._context2d || (this._context2d = new Context2d(this)); 125 | this.context = ctx; 126 | ctx.canvas = this; 127 | return ctx; 128 | } 129 | }; 130 | 131 | /** 132 | * Create a `PNGStream` for `this` canvas. 133 | * 134 | * @return {PNGStream} 135 | * @api public 136 | */ 137 | 138 | Canvas.prototype.pngStream = 139 | Canvas.prototype.createPNGStream = function(){ 140 | return new PNGStream(this); 141 | }; 142 | 143 | /** 144 | * Create a synchronous `PNGStream` for `this` canvas. 145 | * 146 | * @return {PNGStream} 147 | * @api public 148 | */ 149 | 150 | Canvas.prototype.syncPNGStream = 151 | Canvas.prototype.createSyncPNGStream = function(){ 152 | return new PNGStream(this, true); 153 | }; 154 | 155 | /** 156 | * Create a `JPEGStream` for `this` canvas. 157 | * 158 | * @param {Object} options 159 | * @return {JPEGStream} 160 | * @api public 161 | */ 162 | 163 | Canvas.prototype.jpegStream = 164 | Canvas.prototype.createJPEGStream = function(options){ 165 | return this.createSyncJPEGStream(options); 166 | }; 167 | 168 | /** 169 | * Create a synchronous `JPEGStream` for `this` canvas. 170 | * 171 | * @param {Object} options 172 | * @return {JPEGStream} 173 | * @api public 174 | */ 175 | 176 | Canvas.prototype.syncJPEGStream = 177 | Canvas.prototype.createSyncJPEGStream = function(options){ 178 | options = options || {}; 179 | return new JPEGStream(this, { 180 | bufsize: options.bufsize || 4096 181 | , quality: options.quality || 75 182 | , progressive: options.progressive || false 183 | }); 184 | }; 185 | 186 | /** 187 | * Return a data url. Pass a function for async support (required for "image/jpeg"). 188 | * 189 | * @param {String} type, optional, one of "image/png" or "image/jpeg", defaults to "image/png" 190 | * @param {Object|Number} encoderOptions, optional, options for jpeg compression (see documentation for Canvas#jpegStream) or the JPEG encoding quality from 0 to 1. 191 | * @param {Function} fn, optional, callback for asynchronous operation. Required for type "image/jpeg". 192 | * @return {String} data URL if synchronous (callback omitted) 193 | * @api public 194 | */ 195 | 196 | Canvas.prototype.toDataURL = function(a1, a2, a3){ 197 | // valid arg patterns (args -> [type, opts, fn]): 198 | // [] -> ['image/png', null, null] 199 | // [qual] -> ['image/png', null, null] 200 | // [undefined] -> ['image/png', null, null] 201 | // ['image/png'] -> ['image/png', null, null] 202 | // ['image/png', qual] -> ['image/png', null, null] 203 | // [fn] -> ['image/png', null, fn] 204 | // [type, fn] -> [type, null, fn] 205 | // [undefined, fn] -> ['image/png', null, fn] 206 | // ['image/png', qual, fn] -> ['image/png', null, fn] 207 | // ['image/jpeg', fn] -> ['image/jpeg', null, fn] 208 | // ['image/jpeg', opts, fn] -> ['image/jpeg', opts, fn] 209 | // ['image/jpeg', qual, fn] -> ['image/jpeg', {quality: qual}, fn] 210 | // ['image/jpeg', undefined, fn] -> ['image/jpeg', null, fn] 211 | 212 | if (this.width === 0 || this.height === 0) { 213 | // Per spec, if the bitmap has no pixels, return this string: 214 | return "data:,"; 215 | } 216 | 217 | var type = 'image/png'; 218 | var opts = {}; 219 | var fn; 220 | 221 | if ('function' === typeof a1) { 222 | fn = a1; 223 | } else { 224 | if ('string' === typeof a1 && FORMATS.indexOf(a1.toLowerCase()) !== -1) { 225 | type = a1.toLowerCase(); 226 | } 227 | 228 | if ('function' === typeof a2) { 229 | fn = a2; 230 | } else { 231 | if ('object' === typeof a2) { 232 | opts = a2; 233 | } else if ('number' === typeof a2) { 234 | opts = {quality: Math.min(0, Math.max(1, a2)) * 100}; 235 | } 236 | 237 | if ('function' === typeof a3) { 238 | fn = a3; 239 | } else if (undefined !== a3) { 240 | throw new TypeError(typeof a3 + ' is not a function'); 241 | } 242 | } 243 | } 244 | 245 | if ('image/png' === type) { 246 | if (fn) { 247 | this.toBuffer(function(err, buf){ 248 | if (err) return fn(err); 249 | fn(null, 'data:image/png;base64,' + buf.toString('base64')); 250 | }); 251 | } else { 252 | return 'data:image/png;base64,' + this.toBuffer().toString('base64'); 253 | } 254 | 255 | } else if ('image/jpeg' === type) { 256 | if (undefined === fn) { 257 | throw new Error('Missing required callback function for format "image/jpeg"'); 258 | } 259 | 260 | var stream = this.jpegStream(opts); 261 | // note that jpegStream is synchronous 262 | var buffers = []; 263 | stream.on('data', function (chunk) { 264 | buffers.push(chunk); 265 | }); 266 | stream.on('error', function (err) { 267 | fn(err); 268 | }); 269 | stream.on('end', function() { 270 | var result = 'data:image/jpeg;base64,' + Buffer.concat(buffers).toString('base64'); 271 | fn(null, result); 272 | }); 273 | } 274 | }; 275 | -------------------------------------------------------------------------------- /src/node_modules/canvas/lib/image.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Canvas - Image 4 | * Copyright (c) 2010 LearnBoost 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Canvas = require('./bindings') 13 | , Image = Canvas.Image; 14 | 15 | /** 16 | * Src setter. 17 | * 18 | * - convert data uri to `Buffer` 19 | * 20 | * @param {String|Buffer} val filename, buffer, data uri 21 | * @api public 22 | */ 23 | 24 | Image.prototype.__defineSetter__('src', function(val){ 25 | if ('string' == typeof val && 0 == val.indexOf('data:')) { 26 | val = val.slice(val.indexOf(',') + 1); 27 | this.source = new Buffer(val, 'base64'); 28 | } else { 29 | this.source = val; 30 | } 31 | }); 32 | 33 | /** 34 | * Src getter. 35 | * 36 | * TODO: return buffer 37 | * 38 | * @api public 39 | */ 40 | 41 | Image.prototype.__defineGetter__('src', function(){ 42 | return this.source; 43 | }); 44 | 45 | /** 46 | * Inspect image. 47 | * 48 | * TODO: indicate that the .src was a buffer, data uri etc 49 | * 50 | * @return {String} 51 | * @api public 52 | */ 53 | 54 | Image.prototype.inspect = function(){ 55 | return '[Image' 56 | + (this.complete ? ':' + this.width + 'x' + this.height : '') 57 | + (this.src ? ' ' + this.src : '') 58 | + (this.complete ? ' complete' : '') 59 | + ']'; 60 | }; 61 | -------------------------------------------------------------------------------- /src/node_modules/canvas/lib/jpegstream.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Canvas - JPEGStream 4 | * Copyright (c) 2010 LearnBoost 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Stream = require('stream').Stream; 13 | 14 | /** 15 | * Initialize a `JPEGStream` with the given `canvas`. 16 | * 17 | * "data" events are emitted with `Buffer` chunks, once complete the 18 | * "end" event is emitted. The following example will stream to a file 19 | * named "./my.jpeg". 20 | * 21 | * var out = fs.createWriteStream(__dirname + '/my.jpeg') 22 | * , stream = canvas.createJPEGStream(); 23 | * 24 | * stream.pipe(out); 25 | * 26 | * @param {Canvas} canvas 27 | * @param {Boolean} sync 28 | * @api public 29 | */ 30 | 31 | var JPEGStream = module.exports = function JPEGStream(canvas, options, sync) { 32 | var self = this 33 | , method = sync 34 | ? 'streamJPEGSync' 35 | : 'streamJPEG'; 36 | this.options = options; 37 | this.sync = sync; 38 | this.canvas = canvas; 39 | this.readable = true; 40 | // TODO: implement async 41 | if ('streamJPEG' == method) method = 'streamJPEGSync'; 42 | process.nextTick(function(){ 43 | canvas[method](options.bufsize, options.quality, options.progressive, function(err, chunk){ 44 | if (err) { 45 | self.emit('error', err); 46 | self.readable = false; 47 | } else if (chunk) { 48 | self.emit('data', chunk); 49 | } else { 50 | self.emit('end'); 51 | self.readable = false; 52 | } 53 | }); 54 | }); 55 | }; 56 | 57 | /** 58 | * Inherit from `EventEmitter`. 59 | */ 60 | 61 | JPEGStream.prototype.__proto__ = Stream.prototype; 62 | -------------------------------------------------------------------------------- /src/node_modules/canvas/lib/pngstream.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Canvas - PNGStream 4 | * Copyright (c) 2010 LearnBoost 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Stream = require('stream').Stream; 13 | 14 | /** 15 | * Initialize a `PNGStream` with the given `canvas`. 16 | * 17 | * "data" events are emitted with `Buffer` chunks, once complete the 18 | * "end" event is emitted. The following example will stream to a file 19 | * named "./my.png". 20 | * 21 | * var out = fs.createWriteStream(__dirname + '/my.png') 22 | * , stream = canvas.createPNGStream(); 23 | * 24 | * stream.pipe(out); 25 | * 26 | * @param {Canvas} canvas 27 | * @param {Boolean} sync 28 | * @api public 29 | */ 30 | 31 | var PNGStream = module.exports = function PNGStream(canvas, sync) { 32 | var self = this 33 | , method = sync 34 | ? 'streamPNGSync' 35 | : 'streamPNG'; 36 | this.sync = sync; 37 | this.canvas = canvas; 38 | this.readable = true; 39 | // TODO: implement async 40 | if ('streamPNG' == method) method = 'streamPNGSync'; 41 | process.nextTick(function(){ 42 | canvas[method](function(err, chunk, len){ 43 | if (err) { 44 | self.emit('error', err); 45 | self.readable = false; 46 | } else if (len) { 47 | self.emit('data', chunk, len); 48 | } else { 49 | self.emit('end'); 50 | self.readable = false; 51 | } 52 | }); 53 | }); 54 | }; 55 | 56 | /** 57 | * Inherit from `EventEmitter`. 58 | */ 59 | 60 | PNGStream.prototype.__proto__ = Stream.prototype; -------------------------------------------------------------------------------- /src/node_modules/canvas/node_modules/nan/.dntrc: -------------------------------------------------------------------------------- 1 | ## DNT config file 2 | ## see https://github.com/rvagg/dnt 3 | 4 | NODE_VERSIONS="\ 5 | master \ 6 | v0.11.13 \ 7 | v0.10.30 \ 8 | v0.10.29 \ 9 | v0.10.28 \ 10 | v0.10.26 \ 11 | v0.10.25 \ 12 | v0.10.24 \ 13 | v0.10.23 \ 14 | v0.10.22 \ 15 | v0.10.21 \ 16 | v0.10.20 \ 17 | v0.10.19 \ 18 | v0.8.28 \ 19 | v0.8.27 \ 20 | v0.8.26 \ 21 | v0.8.24 \ 22 | " 23 | OUTPUT_PREFIX="nan-" 24 | TEST_CMD=" \ 25 | cd /dnt/ && \ 26 | npm install && \ 27 | node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild --directory test && \ 28 | node_modules/.bin/tap --gc test/js/*-test.js \ 29 | " 30 | 31 | -------------------------------------------------------------------------------- /src/node_modules/canvas/node_modules/nan/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright (c) 2016 NAN contributors 5 | ----------------------------------- 6 | 7 | *NAN contributors listed at * 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | -------------------------------------------------------------------------------- /src/node_modules/canvas/node_modules/nan/appveyor.yml: -------------------------------------------------------------------------------- 1 | # http://www.appveyor.com/docs/appveyor-yml 2 | 3 | # Test against these versions of Io.js and Node.js. 4 | environment: 5 | matrix: 6 | # node.js 7 | - nodejs_version: "0.8" 8 | - nodejs_version: "0.10" 9 | - nodejs_version: "0.12" 10 | - nodejs_version: "3" 11 | - nodejs_version: "4" 12 | - nodejs_version: "5" 13 | 14 | # Install scripts. (runs after repo cloning) 15 | install: 16 | # Get the latest stable version of Node 0.STABLE.latest 17 | - ps: Install-Product node $env:nodejs_version 18 | - IF %nodejs_version% EQU 0.8 npm -g install npm@2 19 | - IF %nodejs_version% EQU 0.8 set PATH=%APPDATA%\npm;%PATH% 20 | - npm -g install npm 21 | - IF %nodejs_version% NEQ 0.8 set PATH=%APPDATA%\npm;%PATH% 22 | # Typical npm stuff. 23 | - npm install 24 | - npm run rebuild-tests 25 | 26 | # Post-install test scripts. 27 | test_script: 28 | # Output useful info for debugging. 29 | - node --version 30 | - npm --version 31 | # run tests 32 | - IF %nodejs_version% LSS 1 (npm test) ELSE (IF %nodejs_version% LSS 4 (iojs node_modules\tap\bin\tap.js --gc test/js/*-test.js) ELSE (node node_modules\tap\bin\tap.js --gc test/js/*-test.js)) 33 | 34 | # Don't actually build. 35 | build: off 36 | 37 | # Set build version format here instead of in the admin panel. 38 | version: "{build}" 39 | -------------------------------------------------------------------------------- /src/node_modules/canvas/node_modules/nan/doc/.build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | files=" \ 4 | methods.md \ 5 | scopes.md \ 6 | persistent.md \ 7 | new.md \ 8 | converters.md \ 9 | maybe_types.md \ 10 | script.md \ 11 | errors.md \ 12 | buffers.md \ 13 | callback.md \ 14 | asyncworker.md \ 15 | string_bytes.md \ 16 | object_wrappers.md \ 17 | v8_internals.md \ 18 | v8_misc.md \ 19 | node_misc.md \ 20 | " 21 | 22 | __dirname=$(dirname "${BASH_SOURCE[0]}") 23 | head=$(perl -e 'while (<>) { if (!$en){print;} if ($_=~/