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

Viewed images do not load #19651

Closed
delvh opened this issue May 7, 2022 · 3 comments · Fixed by #19919
Closed

Viewed images do not load #19651

delvh opened this issue May 7, 2022 · 3 comments · Fixed by #19919
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@delvh
Copy link
Member

delvh commented May 7, 2022

Description

Since #19007, you can mark files in a PR as viewed.
Viewing an image, however, breaks viewing this image (see screenshots).
As soon as you de-view the image and reload the page, everything works as expected.

Screenshots

Normal/ Expected

image

Error Case

image

Gitea Version

1.17.0+dev-546-g5ca224a78

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Linux

Browser Version

Firefox 99

@delvh delvh added type/bug topic/ui Change the appearance of the Gitea UI labels May 7, 2022
@Gusted Gusted added this to the 1.17.0 milestone May 8, 2022
@delvh
Copy link
Member Author

delvh commented Jun 8, 2022

I've gathered some additional information in the meantime, but I don't know how to fix it yet:
a) The screenshot above was for a SVG. "Luckily", this applies to images of all types, because I could confirm it with a PNG as well.
b) The reason for this issue is that both the enclosing span (and subsequently most likely through JS the image as well) get their width and height set to 0:
image
c) This leads me to assume that the width and height calculation fail because the image is not visible initially, and thus in good old JS fashion the calculated values default to 0 instead of throwing an error

I've looked through the corresponding code, but didn't find anything that looked as if it would support this hypothesis.

@wxiaoguang
Copy link
Contributor

I will take a look at it.

@wxiaoguang
Copy link
Contributor

zeripath pushed a commit that referenced this issue Jun 8, 2022
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants