nextcloud / news-android

📱🗞️ Android client for the Nextcloud news/feed reader app
https://play.google.com/store/apps/details?id=de.luhmer.owncloudnewsreader
GNU Affero General Public License v3.0
686 stars 258 forks source link

enable use of image proxies #1112

Open iNtEgraIR2021 opened 2 years ago

iNtEgraIR2021 commented 2 years ago

Hi,

I love this great app. Also thumbs up 👍🏼 for you fast reaction to the security incident fixed in the last release.

As to my personal understanding this app downloads images straight from their (external) sources it would be a great improvement in terms of UX to me personal to be able to use an image proxy. (say images.weserv.nl or external.duckduckgo.com, or a self hosted server etc. ...).

That would increase privacy and might also decrease bandwidth usage. (say by using webp output instead of original png or jpg).

It should only take an additional user preference and a format string in DownloadImageHandler.java.

The user would enter e.g. https://weserv.images.nl?url=%s&output=webp.

Looking forward to your feedback.

Regards, Petra

David-Development commented 2 years ago

@iNtEgraIR2021 Thank you for the proposal! Adding it in the DownloadImageHandler would only work images that are dowloaded by the app itself

In the detail view images are downloaded by the WebView. In order to redirect them through an image proxy there are two options:

  1. Intercept all image requests and redirect them
  2. Rewrite all URLs in the HTML and use the image proxy there

I'm not sure which one would have less sideeffects.. both options require that the image urls have proper file extensions to match against) (I personally like the first option better). In general from a privacy standpoint I agree that it makes sense to support proxies. However quite a few publishers use advertisement etc as well which can be used for tracking so I'm not sure how big the benefit will be in the end.

iNtEgraIR2021 commented 2 years ago

Hi @David-Development

thanks for looking into this 👍🏼

Option 1 sounds promising to me.

David-Development commented 2 years ago

As a side note: I added images.weserv.nl as a proxy to convert SVG favicons to webp favicons since our image loading library doesn't support SVGs. -> https://github.com/nextcloud/news-android/pull/1115

iNtEgraIR2021 commented 2 years ago

Thanks for working on this so quickly :+1: Looking forward to the integration of this PR.