Skip to content

Small images display at native tiny size in Viewer β€” no minimum scale appliedΒ #3196

Description

@vladopol

Bug description

When a shared image fits entirely within Talk's preview constraints
(600 px wide Γ— 384 px tall), it is shown at native 1:1 pixel size β€”
both as a chat thumbnail and when opened in the Viewer.
For small images this makes the Viewer indistinguishable from the thumbnail:
clicking the image appears to do nothing useful.

The Viewer should always scale images to fill a readable portion of the
viewport, regardless of native dimensions.

Steps to reproduce

  1. Share two PNG images in a Talk room:
    • Image A: 840Γ—91 px (wider than 600 px constraint)
    • Image B: 458Γ—57 px (fits within 600Γ—384 px β€” both dimensions smaller)
  2. Click Image A β†’ opens visibly larger than the chat thumbnail βœ“
  3. Click Image B β†’ appears the same tiny size as the chat thumbnail βœ—

Expected behavior

Both images open in the Viewer scaled to a readable size,
regardless of their native pixel dimensions.

Actual behavior

Image B (458Γ—57 px) is displayed at 1:1 native pixels.
The Viewer popup looks identical in size to the inline chat thumbnail.

Both images return the same Talk API metadata:

{ "mimetype": "image/png", "preview-available": "yes" }

The only difference is width/height.

Root cause

FilePreview.vue β†’ imageContainerStyle:

const sizeMultiplicator = Math.min(
    (heightConstraint > height ? 1 : heightConstraint / height),
    (widthConstraint  > width  ? 1 : widthConstraint  / width)
)

When both dimensions are below the constraints (600Γ—384 px),
sizeMultiplicator = Math.min(1, 1) = 1.
There is no lower bound β€” images are never scaled up.

Image A (840Γ—91): width exceeds 600 px β†’ sizeMultiplicator = 600/840 = 0.71
β†’ displayed at 600Γ—65 px (noticeably larger than thumbnail) βœ“

Image B (458Γ—57): both dimensions fit β†’ sizeMultiplicator = 1
β†’ displayed at 458Γ—57 px (same as thumbnail) βœ—

Environment

  • Nextcloud: 33.0.4
  • Nextcloud Talk: 23.0.5
  • Browsers: Chrome 148, Safari β€” Windows, macOS, web (all platforms)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions