add loading spinner fallback (#202)

* add loading spinner fallback fixes #189

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* handle testing with progress spinners

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* apply fixes and improvements

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add example

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* bug fixes

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* resolves #189

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fix

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2018-03-31 10:51:28 +05:30
committed by Jeffrey Warren
parent fba80bb151
commit 3b791ad58b
20 changed files with 5549 additions and 235 deletions

View File

@@ -32,8 +32,14 @@ module.exports = function PixelManipulation(image, options) {
// this could possibly be more efficient; see
// https://github.com/p-v-o-s/infragram-js/blob/master/public/infragram.js#L173-L181
if(!options.inBrowser)
var pace = require('pace')((pixels.shape[0] * pixels.shape[1]))
if(!options.inBrowser){
try{
var pace = require('pace')((pixels.shape[0] * pixels.shape[1]));
}
catch(e){
options.inBrowser = true;
}
}
for(var x = 0; x < pixels.shape[0]; x++) {
for(var y = 0; y < pixels.shape[1]; y++) {