Added check size limit

This commit is contained in:
Igor Zhukov 2014-10-29 22:05:33 +03:00
parent 6e9dc004c1
commit eeb52e400f

View File

@ -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;