Skip to content

Viewed images do not load #19651

Closed
Closed
@delvh

Description

@delvh

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

Activity

added this to the 1.17.0 milestone on May 8, 2022
delvh

delvh commented on Jun 8, 2022

@delvh
MemberAuthor

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

wxiaoguang commented on Jun 8, 2022

@wxiaoguang
Contributor

I will take a look at it.

wxiaoguang

wxiaoguang commented on Jun 8, 2022

@wxiaoguang
Contributor
added a commit that references this issue on Jun 8, 2022
8fee7c4
added a commit that references this issue on Aug 24, 2022
faf34a1
locked and limited conversation to collaborators on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @wxiaoguang@Gusted@delvh

      Issue actions

        Viewed images do not load · Issue #19651 · go-gitea/gitea