From eeb52e400fc130bb014f3d77b7b745e595e4bcd7 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 29 Oct 2014 22:05:33 +0300 Subject: [PATCH] Added check size limit --- app/js/directives.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/js/directives.js b/app/js/directives.js index 09e9235c..21c6439e 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1531,8 +1531,9 @@ angular.module('myApp.directives', ['myApp.filters']) var realImageWidth, realImageHeight; AppDocsManager.downloadDoc($scope.document.id).then(function (url) { var image = new Image(); + var limit = 100; // 2 sec var checkSizes = function (e) { - if (!image.height || !image.width) { + if ((!image.height || !image.width) && --limit) { return; } realImageWidth = image.width;