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

Photoswipe: Pictures stay small when clicked - as user I would expect a higher resolution image #934

Closed
ottok opened this issue Jan 28, 2024 · 1 comment

Comments

@ottok
Copy link

ottok commented Jan 28, 2024

What happened?

I am using the built-in Photoswipe on my site. Example post at https://optimizedbyotto.com/post/gitlab-mariadb-debian/

When a user clicks on one of the images to zoom in, Photoswipe does open it in an overlay, but the image size stays unchanged.

The image size is controlled by CSS. Initially the width is scaled down to 100% of available space:

image

When clicked Photoswipe adds custom CSS rules:

element.style {
    width: 818px;
    height: 540px;
}

image

The image file itself that gets loaded is the same file all the time: https://optimizedbyotto.com/post/gitlab-mariadb-debian/gitlab-merge-request-example.png (dimensions 1356x896px).

Hugo version

0.122.0

Theme version

1.0.0

What browsers are you seeing the problem on?

Chrome

More information about the browser

No response

Relevant log output

No response

Link to Minimal Reproducible Example

https://optimizedbyotto.com/post/gitlab-mariadb-debian/

CaiJimmy added a commit that referenced this issue Feb 5, 2024
This is because `img.width.toString()` returns the `<img>` element dimension, not the real image dimension (stored in the `width` attribute).

closes #934
@ottok
Copy link
Author

ottok commented Feb 10, 2024

I confirm this is fixed now, zoomed image is now large and actually zoomed and this issue can be closed.

While testing this I discovered another issue, which I filed as #939.

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

2 participants