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

This update is based upon issue #213 || "If an image is taking longer to download than usual..." #229

Closed
wants to merge 1 commit into from

Conversation

anandkkpr
Copy link

Quote:
"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."

I've added a comment into that issue's thread and would've wanted to update Michael's code itself but was unable to find out how to do so - I'm a noobie to GitHub... So please forgive me if I'm doing this the wrong way and point me in the right direction if you know how to modify a user-submitted "pull request".

I've commented the code as best as I know how and if you wish to see the full reasoning for why I'm submitting this, please visit the original issue:

#213 (comment)

Many thanks for your kind patience!

Best regards,

Anand

Comments from Issue #213

Hey there!

I found that the fix implemented above was NOT working in Firefox for some reason (version 7.0.1).

I rewrote the section submitted by Michael Weichert and got it to work for me. If you wish to see it in action, please visit http://gaysil.com/my-old-portfolio.

I do not know how to add my changes or "request a pull" for my changes as I'm new to GitHub... thus I've simply pasted the block of code below:

EDIT (2011-12-03):

@aino:
I noticed the comment from @janpub and when I came back to read it, realised that I'd not commented my code, nor the logic behind it. I've updated the code block above with clarification on the purpose for each section. There's also a more human-readable version of the commenting below in my reply to @janpub...

By the way, I never mentioned it to you aino (and this may not be the place for it) but I'll say it now, you are AWESOME and I LOVE Galleria and the way you've built it, you are a role model to me and I thank you for sharing Galleria with the world! Thanks!

@janpub:
Hey there! Just curious about whether you tried replacing mweichert's code with the code I submitted. If you replace Micheal's stuff with what I've written in the nightly build, it should work. I was in a bit of a rush when I submitted the suggestion and didn't explain myself properly. Essentially, IMHO the image was not loading (for me in FF7+) because at the moment that the browser engine started to parse that part of the code, the image's container was set to "display:none".

This is something I've come across before - a browser not admitting that an element has a height or width (like an ) if the parent is set to "display:none"... this is because, as such, the parent is = 0 dimensions and so the engine simply doesn't bother to calculate the dimensions of child elements.

It's for this reason that my code creates a "dummyContainer" which is an element that is "display:static" BUT

    1. set to be a direct child of the
    1. positioned to absolute and then left-positioned to -9999px which is further off screen than any desktop can currently support (including 3-4 monitors in eye-finity display mode)...
      thus, the dummyContainer's dimensions along with the dimensions of the child are calculated and then returned as expected by aino's original block of code.

@anandkkpr
Copy link
Author

Sorry everyone for committing the same thing twice. I'm pretty new to GIT and thought I'd made a mistake when I submitted my pull request a few minutes ago. I can see that there's not problem there - didn't realise that the following line:

  •        }( this, callback, src ));
    
  •        })( this, callback, src );
    

was not duplication but was just the change in syntax showing up as an update...

Please feel free to comment here if you need further clarification on my end about my suggested changes.

Thanks for your patience!

@davidhellsing
Copy link
Contributor

This should have been fixed in this revision: 65d673c#src/galleria.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants