diff --git a/api/LICENSE.html b/api/LICENSE.html index da11e826..1491712e 100644 --- a/api/LICENSE.html +++ b/api/LICENSE.html @@ -129,7 +129,7 @@
+
+ +
+

+ - (void) nodeFileReady(err, data) + (bound) +

+
@@ -1457,7 +1476,7 @@

Parameters:

  @version:
-    release: "4.1.1"
-    date: "4/8/2013"
+ release: "4.1.2" + date: "7/27/2013" @@ -661,14 +661,20 @@

caman.coffee

  initNode: ->
     Log.debug "Initializing for NodeJS"
 
+    if typeof @initObj is "string"
+      fs.readFile @initObj, @nodeFileReady
+    else
+      @nodeFileReady null, @initObj
+
+  nodeFileReady: (err, data) =>
+    throw err if err
+
     @image = new Image()
-    @image.onload = =>
-      Log.debug "Image loaded. Width = #{@imageWidth()}, Height = #{@imageHeight()}"
-      @canvas = new Canvas @imageWidth(), @imageHeight()
-      @finishInit()
+    @image.src = data
 
-    @image.onerror = (err) -> throw err
-    @image.src = @initObj
+ Log.debug "Image loaded. Width = #{@imageWidth()}, Height = #{@imageHeight()}" + @canvas = new Canvas @imageWidth(), @imageHeight() + @finishInit() @@ -903,7 +909,7 @@

caman.coffee

width: @canvas.width height: @canvas.height - Store.put @id, @ + Store.put @id, @ unless Caman.NodeJS @callback.call @,@ diff --git a/package.json b/package.json index ea8505e7..05710924 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "caman", - "version": "4.1.1", + "version": "4.1.2", "description": "Javascript (Ca)nvas (Man)ipulation for NodeJS and the browser", "keywords": ["canvas", "image", "manipulate", "filter", "image manipulation", "editing"], "homepage": "http://camanjs.com", diff --git a/src/core/caman.coffee b/src/core/caman.coffee index e5a7b770..3c7739a5 100644 --- a/src/core/caman.coffee +++ b/src/core/caman.coffee @@ -25,8 +25,8 @@ else class Caman extends Module # The current version. @version: - release: "4.1.1" - date: "4/8/2013" + release: "4.1.2" + date: "7/27/2013" # @property [Boolean] Debug mode enables console logging. @DEBUG: false