From 36d0162b8bd434ce396d46db11df877a93456b6b Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 24 May 2012 08:56:42 +0200 Subject: [PATCH] fix a bug in image.encode --- source/Ox.Image/Ox.Image.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Ox.Image/Ox.Image.js b/source/Ox.Image/Ox.Image.js index 272748fd..ca065a63 100644 --- a/source/Ox.Image/Ox.Image.js +++ b/source/Ox.Image/Ox.Image.js @@ -358,11 +358,11 @@ Ox.load.Image = function(options, callback) { } str = str.substr(0, Math.ceil(cap)); // Create an array of bit values - bin = Ox.flatten(Ox.map(str, function(chr) { + bin = Ox.flatten(Ox.map(str.split(''), function(chr) { return Ox.range(8).map(function(i) { return chr.charCodeAt(0) >> 7 - i & 1; }); - }).split(',')); + })); b = 0; that.forEach(function(rgba, xy, index) { // If alpha is not 255, the RGB values may not be preserved @@ -529,7 +529,7 @@ Ox.load.Image = function(options, callback) { var data = self.data, forEach = callback ? Ox.nonblockingForEach : Ox.forEach; forEach(Ox.range(0, data.length, 4), function(i) { - return iterator([ + iterator([ data[i], data[i + 1], data[i + 2], data[i + 3] ], getXY(i), i); }, callback);