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

Wrong html image attributes set by featherlight #391

Open
designseer opened this issue Aug 4, 2019 · 2 comments
Open

Wrong html image attributes set by featherlight #391

designseer opened this issue Aug 4, 2019 · 2 comments

Comments

@designseer
Copy link

Hello,

This is one of the issues everyone has. The image in lightbox modal window is always 1px less in width and height.

Problem is negligible but screenshot of text looks blurred when the final image is resized by 1px.

Need an example from my website? No need as I can show this issue on the plugin website itself.
https://noelboss.github.io/featherlight/

Click on Image. (droplets.jpg)

Real Resolution of droplets.jpg = 1000 x 700

Featherlight resolution = 999 x 699

2019-08-04_073418

@marcandre
Copy link
Collaborator

It's definitely possible there's a rounding error in the resizing code. A PR would be most welcome.

@spylypenko
Copy link

Hello, I have investigated this issue.
It is caused by this old hack d605014

I think this hack is not useful anymore.
The ratio calculation included padding and border of the container, and it was the real reason why the scrollbars appeared.
The current version uses the content width and height, so I think it is safe to remove -1 here:

w / (this.$content.parent().width()-1),
h / (this.$content.parent().height()-1));

Could you please confirm if this is ok.

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

No branches or pull requests

3 participants