zulip / zulip-mobile

Zulip mobile apps for Android and iOS.
https://zulip.com/apps/
Apache License 2.0
1.28k stars 643 forks source link

Use thumbnails in message list #3790

Open gnprice opened 4 years ago

gnprice commented 4 years ago

Images in a chat thread are often big -- for example, photos or screenshots from a modern phone. In particular they often have a lot more pixels than we'll actually show in the message list.

Currently, I believe, we download the original images, no matter how giant, when showing them in the message list. That's often slow, especially on a slow network connection, and also battery-draining.

The Zulip server has a feature to generate (and cache) smaller versions of images that are uploaded. We should use that feature, in order to download versions that are an appropriate size for what we'll actually display. (As discussed in the comments below, the server's thumbnailing support is still experimental and not ready to use, so this issue is blocked on completing that.)

See also:

timabbott commented 4 years ago

I think #2749 would make a significant difference on this front, because in practice most multi-megabytes image uploads will be from phones (images sourced from somewhere else usually are smaller).

I should add that the third-party library we're using on the server for thumbnailing seems to have failed to do the Python 3 migration, suggesting its unmaintained, and we're likely to need to switch to something else. So we may be further away on the server than we'd like for doing this feature the way we'd like to.

gnprice commented 4 years ago

I think #2749 would make a significant difference on this front, because in practice most multi-megabytes image uploads will be from phones (images sourced from somewhere else usually are smaller).

True, but it's also costly to the user experience: it means that when you e.g. post a photo from your phone, it'll be lower quality, even when people really try to look at the details by opening it up in the lightbox or downloading it. I think in particular some people will regularly be annoyed to find that they can't post original-quality photos.

I should add that the third-party library we're using on the server for thumbnailing seems to have failed to do the Python 3 migration, suggesting its unmaintained, and we're likely to need to switch to something else. So we may be further away on the server than we'd like for doing this feature the way we'd like to.

Oof, that is indeed a bad sign. Thanks for the update.

awasthishubh commented 4 years ago

@gnprice Wouldn't it be nice to show an image preloader or a just a greyed-out default image while the original image ( or thumbnail if added) is being loaded?

leofidus commented 4 years ago

@awasthishubh Agreed. In my eyes the ideal user experience would be to load a 16x16px thumbnail as well a regular thumbnail simultaneously. Since the 16x16px thumbnail is tiny it loads quickly and can be shown as preview while the regular thumbnail is still loading. The original image should only load if the user actually clicks the image to view it in a lightbox or to download it.

jcam commented 4 years ago

Out of curiosity, not knowing the project well, is there any sort of time estimate on this fix? My group is evaluating chat tools, and this combined with the reload-all-messages-every-time bug caused high enough cell data usage for the whole project to currently be a non-starter (despite how much we like the threading)

timabbott commented 4 years ago

We don't have a timeline on the thumbnailing side. The caching issue that causes files to get redownloaded is something I expect we'll be investing in fixing relatively soon, however.

chrisbobbe commented 4 years ago

The caching issue that causes files to get redownloaded is something I expect we'll be investing in fixing relatively soon, however.

Indeed; yesterday, @gnprice unblocked https://github.com/zulip/zulip-mobile/issues/3026 (opened Oct. 2018) by clarifying the author's use of the term "re-render." With that in mind, and from this report and Tim's comment, I'm marking #3026 as P1.

gnprice commented 4 years ago

@awasthishubh Sure, that could be a nice small improvement to the UI. It wouldn't really affect this issue, though -- the problem is how long it takes to see the real image, and how much energy and potentially cellular data it consumes.

@leofidus Once we have thumbnailing at all (which is currently blocked on the server supporting it), we can experiment with specifics like that.

@jcam That sounds like a lot! Thanks for the report. I'm curious to hear more details for debugging; asked you over on #3555, which is about high cell data usage.

gnprice commented 4 years ago

We've had another report of this at #4215, from someone who had enabled thumbnailing on their 2.1 server and was disappointed when the 3.x upgrade disabled it. See also chat discussion.

The immediate resolution there was (a) clarifying the docs to say the feature is experimental and (b) some pointers on how to perhaps re-enable it. But the real need is to complete the feature so that it's fully supported and just works by default.

maltokyo commented 3 years ago

hi @gnprice - this continues to plague my users, especially the ones on the other side of the world from where the server is located.. In the meantime, did you hear any good ideas to resolve this? I would be happy to sponsor a developer to fix this, so it works on web, desktop, and mobile apps, with the creation of (real) small thumbnails (not just downscaled full-sized images)