terrymun / paver

Paver, a panorama/image viewer replicating the effect seen in Facebook Pages app
MIT License
123 stars 38 forks source link

Initialize paver before the image is fully loaded #3

Closed fregante closed 8 years ago

fregante commented 8 years ago

naturalWidth and naturalHeight are available as soon as the header of the image is loaded, which for panoramas could be available several seconds before the image is fully loaded.

To verify this I used a lightweight polling function and still kept a listener on the full load just in case that happens between each poll, which could save up to 50ms (!!!)

terrymun commented 8 years ago

Thanks for the PR. If it is really better to poll the image header, I will probably refactor your code into the plugin and give you credit, as I'm not really a fan of having loose function declarations floating around the code (I prefer the var based function declaration).

I'll test it out a little and get back to you.

fregante commented 8 years ago

Here, this way you can just pull the PR and you can just leave the credit in the commits :)

terrymun commented 8 years ago

Thanks for the PR. The code will be refactored into the v1.3 release :)