Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into memleakspull
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Dec 6, 2013
2 parents 0bc1aaf + 5cc0a5f commit 134d787
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 19 deletions.
26 changes: 19 additions & 7 deletions History.md
@@ -1,30 +1,42 @@
1.1.2 / 2013-10-31
==================

* NAN dep upgrade, full node@<=0.11.8 compatibility
* Use node::MakeCallback() instead of v8::Function::Call()
* Improve nan location discovery
* Fix enabling gif/jpeg options on Ubuntu 13.04

1.1.1 / 2013-10-09
==================

* add better support for outdated versions of Cairo

1.1.0 / 2013-08-01
1.1.0 / 2013-08-01
==================

* add png compression options
* add jpeg stream progressive mode option
* add png compression options
* add jpeg stream progressive mode option
* fix resource leaks on read errors

1.0.4 / 2013-07-23
1.0.4 / 2013-07-23
==================

* 0.11.4+ compatibility using NAN
* fix typo in context2d for imageSmoothingEnabled

1.0.3 / 2013-06-04
1.0.3 / 2013-06-04
==================

* add "nearest" and "bilinear" to patternQuality
* fix fread() retval check (items not bytes)
* removed unneeded private fields

1.0.2 / 2013-03-22
1.0.2 / 2013-03-22
==================

* add Context2d#imageSmoothingEnabled=

1.0.1 / 2013-02-25
1.0.1 / 2013-02-25
==================

* travis: test modern node versions
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -109,7 +109,7 @@ _Note: At the moment, `jpegStream()` is the same as `syncJPEGStream()`, both
are synchronous_

```javascript
var stream = canvas.JPEGStream({
var stream = canvas.jpegStream({
bufsize: 4096 // output buffer size in bytes, default: 4096
, quality: 75 // JPEG quality (0-100) default: 75
, progressive: false // true for progressive compression, default: false
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Expand Up @@ -21,7 +21,7 @@
'targets': [
{
'target_name': 'canvas',
'include_dirs': ["<!(node -p -e \"require('path').dirname(require.resolve('nan'))\")"],
'include_dirs': ["<!(node -p -e \"require('path').relative('.', require('path').dirname(require.resolve('nan')))\")"],
'sources': [
'src/Canvas.cc',
'src/CanvasGradient.cc',
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{ "name": "canvas"
, "description": "Canvas graphics API backed by Cairo"
, "version": "1.1.0"
, "version": "1.1.2"
, "author": "TJ Holowaychuk <tj@learnboost.com>"
, "keywords": ["canvas", "graphic", "graphics", "pixman", "cairo", "image", "images", "pdf"]
, "homepage": "https://github.com/learnboost/node-canvas"
Expand All @@ -9,7 +9,7 @@
"test": "make test"
}
, "dependencies": {
"nan": "~0.3.0"
"nan": "~0.4.1"
}
, "devDependencies": {
"express": "3.0"
Expand Down
8 changes: 4 additions & 4 deletions src/Canvas.cc
Expand Up @@ -277,7 +277,7 @@ NAN_METHOD(Canvas::ToBuffer) {

if (!args[2]->StrictEquals(Undefined())) {
if (args[2]->IsUint32()) {
filter = args[1]->Uint32Value();
filter = args[2]->Uint32Value();
} else {
return NanThrowTypeError("Invalid filter value.");
}
Expand Down Expand Up @@ -351,7 +351,7 @@ streamPNG(void *c, const uint8_t *data, unsigned len) {
Local<Value>::New(Null())
, buf
, Integer::New(len) };
closure->fn->Call(Context::GetCurrent()->Global(), 3, argv);
MakeCallback(Context::GetCurrent()->Global(), closure->fn, 3, argv);
return CAIRO_STATUS_SUCCESS;
}

Expand Down Expand Up @@ -420,13 +420,13 @@ NAN_METHOD(Canvas::StreamPNGSync) {
NanReturnValue(try_catch.ReThrow());
} else if (status) {
Local<Value> argv[1] = { Canvas::Error(status) };
closure.fn->Call(Context::GetCurrent()->Global(), 1, argv);
MakeCallback(Context::GetCurrent()->Global(), closure.fn, 1, argv);
} else {
Local<Value> argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(Null())
, Integer::New(0) };
closure.fn->Call(Context::GetCurrent()->Global(), 3, argv);
MakeCallback(Context::GetCurrent()->Global(), closure.fn, 3, argv);
}
NanReturnUndefined();
}
Expand Down
2 changes: 1 addition & 1 deletion src/CanvasPattern.cc
Expand Up @@ -17,7 +17,7 @@ Persistent<FunctionTemplate> Pattern::constructor;

void
Pattern::Initialize(Handle<Object> target) {
HandleScope scope;
NanScope();

// Constructor
Local<FunctionTemplate> ctor = FunctionTemplate::New(Pattern::New);
Expand Down
2 changes: 1 addition & 1 deletion src/init.cc
Expand Up @@ -20,7 +20,7 @@

extern "C" void
init (Handle<Object> target) {
HandleScope scope;
NanScope();
Canvas::Initialize(target);
Image::Initialize(target);
ImageData::Initialize(target);
Expand Down
8 changes: 6 additions & 2 deletions util/has_lib.sh
@@ -1,14 +1,18 @@
#!/usr/bin/env bash
has_lib() {
local regex="lib$1.+(so|dylib)$"
local regex="lib$1.+(so|dylib)"

# Add /sbin to path as ldconfig is located there on some systems - e.g. Debian
# (and it still can be used by unprivileged users):
PATH="$PATH:/sbin"
export PATH
# Try using ldconfig on linux systems
for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep -E $regex`; do
return 0
done

# Try just checking common library locations
for dir in /lib /usr/lib /usr/local/lib /opt/local/lib; do
for dir in /lib /usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu; do
test -d $dir && ls $dir | grep -E $regex && return 0
done

Expand Down

0 comments on commit 134d787

Please sign in to comment.