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
Cropped thumbnails open distorted #854
Comments
Thumbnail width/height ratio must match large image ratio if you want zoom in/out animation to work properly. Otherwise – disable the opening/closing transition entirely and do not pass small thumbnail (do not define |
I don't know how to do this, can you give me some suggestions? Thanks. |
Please elaborate what exactly part you don't understand. |
I'm not a programmer so I need some hints to what I'm looking for and where to find it to do as you've suggested: • disable the opening/closing transition entirely Sorry for my ignorance. If it's complicated I won't be able to do it so I'll hire someone. But I'd like to be able to better point him to what needs to be done. No one knows better than the author. Thanks. |
To disable closing/opening transitions add options: hideAnimationDuration:0,
showAnimationDuration: 0 http://photoswipe.com/documentation/options.html |
I think we can solve this issue easily by centering For example, for a placeholder of width 500px and height 400px: |
What do you think @dimsemenov? |
I think that if you can't get a thumbnail image that matches an aspect ratio of a large image (which is quite weird, as it can be cropped via CSS if you need "square" initial grid items) just don't serve it, PhotoSwipe will just display dark rectangle behind it. It looks not very good when image with different aspect ratio loads on top even if it's centered. |
I don't think cropping with css is a solution as we shouldn't mess with the page layout. You might be right about the animation. But in my opinion it's better to make it centred than to leave it as is. As far as I know many other plugins implement it this way too and it looks great. |
Can you please link?
Sure, you may send PR, if it'll be compact – I'll merge it. https://github.com/dimsemenov/PhotoSwipe/blob/master/src/js/items-controller.js#L431 |
I'm not sure where I've seen that. I did an experiment with FancyApps and apparently they preload the image and then stretch/squeeze it to match the thumbnail, which is not that nice. I think centring it would be better than this. Anyway I'll implement it and then we'll see. Thanks btw! |
Works perfect when only width is set (example: W260px X H999px), but if I set a fixed thumbnail size there is a problem when opening the images. They open stretched then quickly "snap" back to normal.
Short video: http://screencast-o-matic.com/watch/co1niIf2VV
Test website: http://master.lightboxlive.com/portfolios/
Please check soon as I makes changes when testing.
Any ideas?
The text was updated successfully, but these errors were encountered: