Could not extract width/height from image in Chrome - absolutely frustrating!

  • Problem
  • Updated 3 years ago
I've been using Galleria (1.2.5) with the latest jquery 1.7 for 4-5 months. So far I haven't experienced many problems, but yesterday one client/visitor said that he received error code

Could not extract width/height from image Traced measures: width:0px, height: 0px.

However, I couldn't reproduce the problem in FF and IE, but I did in Chrome (even though last time I checked it was all ok!) What's worse it happens at random - for example, 3 or more photographs will load correctly then out of nowhere this error will pop out!

I tried many tweaks and corrections but with no effect, whatsoever!

My site is http://ivframes.com. You can try http://ivframes.com/children in Chrome and see for yourself after browsing several images.
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
  • frustrated

Posted 3 years ago

  • 10
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Another client/visitor emailed me and reported the same error in Chrome!

I must say that I tested it with only Galeria's CSS (I deleted the CSS on the site for the test) and basic settings and the error still keeps popping!

Can ANYONE help me?!? I'm losing the customers with this bug.
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
I fixed it myself... well at least I hope. I replaced the existing code with this one:

// Delay the callback to "fix" the Adblock Bug
// http://code.google.com/p/adblockforch...
if ( ( !this.width || !this.height ) ) {
window.setTimeout( (function( img ) {
return function() {
if ( img.width && img.height ) {
complete.call( img );
} else {
try {
$('').attr('src',$(img).attr("src")).load(function() {complete.call( this )})
} catch(error_message) {
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 );
}

However, I'm disappointed that the original maintainer didn't even respond about this issue. What I read in these forums, bunch of people had the same problem and developer(s) never acknowledged it. Huh?
Photo of SneakySnakeS

SneakySnake

  • 12 Posts
  • 0 Reply Likes
Aha! That is what is happening to me. I get those errors in chrome and a fatal stage error in IE6. With chrome it appears to be inconsistent, loading Ok to start and then popping errors after the 3rd or so image load.

I will see if I can apply your fix. Fingers crossed for this newbie.

I couldn't reproduce the error on your page in Chrome. :)
Photo of SneakySnakeS

SneakySnake

  • 12 Posts
  • 0 Reply Likes
Ah Well! No joy! I am too much of a newbie to know where to put it. In the .js file? or in the script in the .html? (It did not work there - I just lost the gallery)

Which code did you replace?
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Ahem... original maintainer/developer STILL hasn't replied here... not even once... oh well...

Sneakysnake, thanks for testing my site!
You have to modify uncompressed code, not the current one that is being used on the site. That's a bit tricky for a newbie.

But tell you what - go to my site and download the galleria.js. I have modified the code and I also compressed the javascript again.

It's on http://ivframes.com/js/galleria.js

Then do "save page as..." and put the same name that you use on your own site for galleria with ".js" extension behind. Upload it back to your site and you're done!

Good luck.
Photo of SneakySnakeS

SneakySnake

  • 12 Posts
  • 0 Reply Likes
I never wanted to kiss someone on the internet so much! :)

Thanks heaps. I have been searching to fix this for days, and was about to either give up and do a thumbnail gallery in html or put a notice up for chrome users.

Now I can get on and finish my site. Time to play with layers to satisfy one library that wants a link on any image from them that goes back to their source.

Cheers ivan!
Photo of Rob

Rob

  • 3 Posts
  • 0 Reply Likes
THANKS! You've just saved me so much time :) :)
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Hahaha, thanks for a kiss Sneaky. ;-)
No problem guys, I'm glad that I saved your time and freed your from regular frustrations. ;)
Photo of keirza

keirza

  • 2 Posts
  • 0 Reply Likes
Ivan, you are the greatest of all time. Thank you!
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Thanks guys.

In case you're a designer or site builder, just to let you know that I work for istockphoto.

http://refer.istockphoto.com/ta.php?l...

If you click on this link (my portfolio) and sign up, you'll get 10 free credits! I can email you to get additional +10 credits. :-) And you can also buy stuff from me.
Photo of keirza

keirza

  • 2 Posts
  • 0 Reply Likes
I already have an account, but I bought a photo:

http://www.istockphoto.com/stock-phot...

Great looking stuff!
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Thanks keirza very much! I appreciate it. :)
Photo of DETLEVSKID

DETLEVSKI

  • 2 Posts
  • 0 Reply Likes
I can confirm the problem here, your workaround works, but I'd rather see a fix in the original code. I have a website with on older version, but I don't have the problem there. What triggers this error ?
Photo of yusuf.akturkkY

yusuf.akturkk

  • 1 Post
  • 0 Reply Likes
I can not reach the Js file and your site ivan. can u fix this problem or send this js file to my mail. yusuf.akturkk@gmail.com i need it really soon please help..
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Yusuf, please try again, maybe the server was down or something... I can access it without any problems now.

Yes, Detlevski, I'd love to see devs to recognize and officially fix this bug! But alas, they don't seem to even pay attention to this thread in this forum... At least we have a fix to have Galleria working in Chrome!
Photo of Xiao Lin

Xiao Lin

  • 4 Posts
  • 0 Reply Likes
This solution works, but it seems to be hiding the problem instead of solving it. I don't get the "Could not extract width/height" message anymore but 30 seconds later this message appears "Image not loaded in 30 seconds: .....". Is anyone else experiencing this?
Photo of Xiao Lin

Xiao Lin

  • 4 Posts
  • 0 Reply Likes
FYI :
Before I used to get both messages "Could not extra width/height...." and 30 seconds later "Image not loaded in 30 seconds:..."
Photo of Massimo Carletti

Massimo Carletti

  • 4 Posts
  • 0 Reply Likes
thank you, it works for me! thank you so much, you rule!!!
Photo of ivan.planinar

ivan.planinar

  • 26 Posts
  • 5 Reply Likes
Sorry xiao Lin, I couldn't reproduce this in chrome. Works normally after the fix.
Photo of Mark SimchockMS

Mark Simchock

  • 13 Posts
  • 0 Reply Likes
I'm a bit frustrated with Galleria myself. On the surface it's a great plugin - nice features, etc.

However, it appears to be VERY picky about how it needs to be set up and how able it is to "compromise" then things aren't exact as it expects.

It's difficult to commit to using something if there's no active support. I'm not saying that's the case here - yet. But I am getting a bit concerned about whether I've found the right solution or not. That is, a solution isn't a solution if it doesn't work, yes?
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
To everyone: this issue has been resolved in the latest beta. You can get it here:

https://github.com/aino/galleria/blob...

We are very sorry for this, there seemed to be an issue with cached images that we couldn’t replicate until we tested in a different environment.
Photo of Mark SimchockMS

Mark Simchock

  • 13 Posts
  • 0 Reply Likes
Thanks David. Sorry to be a pain in your butt.

Do you have a .min version? Or do I have to do that myself?

Thanks again.
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
we just pushed the beta as 1.2.6 stable so you can just download the latest package at http://galleria.aino.se/download/
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
we just pushed the beta as 1.2.6 stable so you can just download the latest package at http://galleria.aino.se/download/
Photo of Mark SimchockMS

Mark Simchock

  • 13 Posts
  • 0 Reply Likes
fyi - In FireFox (PC) then trying to embed a Galleria slideshow in a WordPress post/page I'm still getting:

"Could not extract width/height from image: http://127.0.0.1:4001/wordpress/wp-co.... Traced measures: width:0px, height: 0px."

"Image not loaded in 30 seconds: http://127.0.0.1:4001/wordpress/wp-co..."

This does not happen if the Galleria is in a sidebar widget, footer or header.

Help? :(
Photo of gwcG

gwc

  • 3 Posts
  • 0 Reply Likes
Thanks for getting this fixed David, but a special shout to Ivan for fixing it previously!