Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If an image is taking longer to download than usual, then the "could not extract height/width" error was being displayed. It couldn't be extracted because the image wasn't done downloading yet. #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/galleria.js
Original file line number Diff line number Diff line change
Expand Up @@ -4788,19 +4788,17 @@ Galleria.Picture.prototype = {
// Delay the callback to "fix" the Adblock Bug
// http://code.google.com/p/adblockforchrome/issues/detail?id=3701
if ( ( !this.width || !this.height ) ) {
window.setTimeout( (function( img ) {
return function() {
if ( img.width && img.height ) {
complete.call( img );
} else {
Galleria.raise('Could not extract width/height from image: ' + img.src +
'. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.');
}
};
}( this )), 2);
} else {
complete.call( this );
}
$(this).load(function(response, status){
if (status == 'error') {
Galleria.raise('Could not extract width/height from image: ' + img.src +
'. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.');
}
else complete.call(this);
});
}
else {
complete.call(this);
}
};
}( this, callback, src ));

Expand Down