Skip to content

Small images display at native tiny size in Viewer — no minimum scale applied #3196

@vladopol

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.vueimageContainerStyle:

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