diff --git a/misc/scripts/package-windows-executable.cmd b/misc/scripts/package-windows-executable.cmd index 72e015c2..e27d28d4 100644 --- a/misc/scripts/package-windows-executable.cmd +++ b/misc/scripts/package-windows-executable.cmd @@ -10,7 +10,7 @@ SETLOCAL set MISC_FOLDER=%PISKEL_HOME%\misc set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop - set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win64 + set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win32 ECHO "Updating Piskel icon -- Using Resource Hacker" %RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel.exe", "%DEST_FOLDER%\piskel-logo.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033 diff --git a/src/js/service/CurrentColorsService.js b/src/js/service/CurrentColorsService.js index cce8851c..dacad519 100644 --- a/src/js/service/CurrentColorsService.js +++ b/src/js/service/CurrentColorsService.js @@ -48,15 +48,32 @@ } }; + var batchAll = function (frames, job) { + var batches = []; + frames = frames.slice(0); + while (frames.length) { + batches.push(frames.splice(0, 10)); + } + var result = Q([]); + batches.forEach(function (batch) { + result = result.then(function (results) { + return Q.all(batch.map(job)).then(function (partials) { + return results.concat(partials); + }); + }); + }); + return result; + }; + ns.CurrentColorsService.prototype.updateCurrentColors_ = function () { var layers = this.piskelController.getLayers(); var frames = layers.map(function (l) {return l.getFrames();}).reduce(function (p, n) {return p.concat(n);}); - Q.all( - frames.map(function (frame) { - return this.cachedFrameProcessor.get(frame); - }.bind(this)) - ).done(function (results) { + var job = function (frame) { + return this.cachedFrameProcessor.get(frame); + }.bind(this); + + batchAll(frames, job).then(function (results) { var colors = {}; results.forEach(function (result) { Object.keys(result).forEach(function (color) {