Skip to content

Conversation

@PVince81
Copy link
Member

@PVince81 PVince81 commented Oct 26, 2020

Instead of cropping the previews in the conversation to a square, they
are now using a limited height but their width is computed based on
aspect ratio. This is done by passing different arguments to the
previews endpoint so it delivers a preview with the matching size.

Adjusted styles around the preview to make it look better.

Fixes #3746

This was mentionned in #1805 (comment)

image

Manual Tests

  • wide pictures
  • narrow pictures
  • loading icon looks fine
  • reduced preview when using reply in pic

Instead of cropping the previews in the conversation to a square, they
are now using a limited height but their width is computed based on
aspect ratio. This is done by passing different arguments to the
previews endpoint so it delivers a preview with the matching size.

Adjusted styles around the preview to make it look better.

Signed-off-by: Vincent Petry <[email protected]>
@skjnldsv
Copy link
Member

I'm fine with this, but this is up to @jancborchardt's call :)

.loading {
display: inline-block;
height: 128px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we once also discussed to use more height, e.g. 300? cc @jancborchardt
But not sure what the endpoint does if the image is actually smalled?

Copy link
Member Author

@PVince81 PVince81 Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can check with it. otherwise there's a "mode=fill" option which I'm not sure what it does, might fit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested with a picture of 50x50 and the preview provider doesn't make it bigger.
However the image tag will scale it up, so it will have the same height as the other pictures:
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I found the ticket with the decision to make it 384px: #3746 (comment)

I'll adjust

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with new height:
image

and for a wide image:
image

Was 128, expanded to 384 so it can fill a bit more width as well and
look better.

Signed-off-by: Vincent Petry <[email protected]>
Center the spinner as it looks better overall, except for when the
picture is narrow in the end. But we can't detect the image size
beforehand, so this will do for most use cases.

Signed-off-by: Vincent Petry <[email protected]>
@PVince81
Copy link
Member Author

closing in favor of #4472 which improves the same code further (and I'd like to avoid conflicts)

@PVince81 PVince81 closed this Oct 26, 2020
@PVince81 PVince81 deleted the enh/noid/expand-preview-in-chat branch October 26, 2020 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better preview of the shared files

4 participants