Skip to content

content: Handle image emoji #2

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

Closed
wants to merge 3 commits into from
Closed

content: Handle image emoji #2

wants to merge 3 commits into from

Conversation

chrisbobbe
Copy link
Collaborator

image

… way

The implementation already treats them the same, but now the names
reflect that.

Perhaps one day we'll re-introduce a distinction when we need to.
@chrisbobbe chrisbobbe requested a review from gnprice December 29, 2022 23:59
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks @chrisbobbe for taking care of this! This looks good; small comment below.

One commit-message nit:

$ git uvr --name-only
8089a9551 msglist [nfc]: Explicitly model realm- and zulip-extra emoji the same way
lib/model/content.dart
lib/widgets/content.dart
83005b5ef widgets [nfc]: Make kBaseFontSize a double, instead of inferred int
lib/widgets/content.dart
15d3ba952 content: Handle image emoji
lib/model/content.dart
lib/widgets/content.dart

I'd give all three of these the prefix content.

In particular I've been keeping message_list for the sorts of things that go in the message_list.dart files — basically, everything about the message lists except the contents of the messages. (The contents are a bigger area of work here than they are in the RN app, because we're not using a webview and handing the HTML and CSS to a browser to interpret.)

top: -1.5,
child: Image.network(
adjustedSrc.toString(),
filterQuality: FilterQuality.low,
Copy link
Member

@gnprice gnprice Dec 30, 2022

Choose a reason for hiding this comment

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

This should be FilterQuality.medium, same as for avatars and attached images.

At low, it… actually it looks pretty much fine in your screenshot from iOS, but here's what it is for me on Linux desktop:
image
Pretty pixelated and jagged.

At medium, it looks much better, and pretty similar to what web gets in Chrome on Linux:
image
(left is Flutter desktop, right is Chrome; the shadow is my window manager telling me the window on the right is focused, by having it cast a shadow over neighboring windows.)

… OK, and trying it on Android, on a physical Pixel 5, both low and medium look good; in fact I can't tell them apart, at least not on this emoji at this size. It seems possible that on that device they actually end up selecting the exact same algorithm.

In your testing, do you find low is actually better than medium? If so, perhaps we should choose different algorithms on different platforms.

In any case we almost surely want the same filterQuality value here as in sender avatars, and likely also in attached images. So let's keep it in sync with those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In your testing, do you find low is actually better than medium? If so, perhaps we should choose different algorithms on different platforms.

No, I just figured that emojis are probably close to the smallest images one would want to render, and so low would be appropriate. Seeing that it looks worse than medium on some platforms, and that we don't have anything close to a performance problem yet, I'm happy to use medium. 🙂

@chrisbobbe
Copy link
Collaborator Author

Thanks for the review! Revision pushed.

@chrisbobbe
Copy link
Collaborator Author

chrisbobbe commented Dec 30, 2022

Hmm, I did push my revision to my branch, pr-handle-image-emoji; the tip is chrisbobbe@5f87cc5. But I'm not seeing this PR update to reflect that. Is there maybe a repo-level setting?

Ah, I think probably this has to do with this repo's move from gnprice to the zulip org.

@gnprice
Copy link
Member

gnprice commented Dec 31, 2022

Hmm, I did push my revision to my branch, pr-handle-image-emoji; the tip is chrisbobbe@5f87cc5. But I'm not seeing this PR update to reflect that. Is there maybe a repo-level setting?

That page 404s for me, and I can't fetch from that repo over Git.

I suspect the issue is that your fork is private (which would have been because this repo was still private when you made the fork), while this repo is now public. I guess I'll get to see the new revision when I'm back from vacation in January 🙂

@chrisbobbe chrisbobbe closed this by deleting the head repository Jan 9, 2023
@chrisbobbe
Copy link
Collaborator Author

My next revision is over at #4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants