Open-event-droidgen: Size of Speaker Images to very large.

Created on 8 Mar 2017  Â·  22Comments  Â·  Source: fossasia/open-event-droidgen

Actual Behaviour
Just installed the app on my device and after 10mins of use the app has used 300MB of mobile data.
The size of speaker images is the major reason behind this.
Size of some images is as high as 6.2MB. (Speaker - Blair Layton, Image - https://storage.googleapis.com/eventyay.com/events/6/speakers/2312/photo/TXZMK1JFUm/f3069efd-8cdf-4786-9e59-046f95f41440.png)

Expected Behaviour
The images must be compressed using tinypng or pngcrusher. I guess the same has been done in the project 2017.fossasia.org. We can also reduce size of Sponsor images.

Would you like to work on the issue?
Yes

Most helpful comment

We can use https://rsz.io/ for resizing the image before loading. Only effort required is to modify the image URL before loading in Picasso. @free4murad can work on that I guess, and if required, I'd be happy to help :smile:

All 22 comments

@mananwason @the-dagger
What can we do about this.
Should I update the URLs of the images or do we need to update the api?

@free4murad
another thing we can do is as we are using picasso we can reduce the size of the image using the .resize() parameter of picasso. I think thats a feasable option right now.

@arp95 That will still download the larger photo and then resize while setting it. The point here is to save precious mobile data for user since he might be roaming.

@arp95
the problem is downloading big files.
We need to solve that.

This in turn is related to #1260 too, app must be crashing while handling the large bitmaps . Small bitmaps would also fix that and use very less memory (RAM) for overall better performance. Currently, peak RAM usage go as high as 150mb.

We can use https://rsz.io/ for resizing the image before loading. Only effort required is to modify the image URL before loading in Picasso. @free4murad can work on that I guess, and if required, I'd be happy to help :smile:

@iamareebjamal That is awesome. I didn't know about existence of such a service.

Good find @iamareebjamal https://github.com/iamareebjamal, we can
definitely use this in the app. :+1:

@the-dagger should i make a PR?

Sure :+1:

There is one drawback though, if we use https://rsz.io/ the load time of the images will increase drastically.
What should we do.
@the-dagger @iamareebjamal

@free4murad Try to use this : https://storage.googleapis.com.rsz.io/eventyay.com/events/6/speakers/2236/photo/TDdIUVJIRD/717127c3-d441-41c7-808e-f4378f74b940.png?width=200
I mean change the url like this. I could find any significant difference while downloading. (This is a particular case)

@free4murad The load time will be slow for first time only even if that happens, then it will be retrieved from disk cache (Picasso) so it must not make a major difference.

@betterclever @iamareebjamal @the-dagger
I will proceed with this method then.

@the-dagger rsz.io is not Open Source as far as I can see. Also, we want to ensure that the Android builder can work potentially as a commercial service. Depending on third-parties that are neither Open Source nor provide a commercial service, that we can rely on is not a good idea. Please do not use rsz.io and do not merge PRs with rsz.io or similar services. Use existing Open Source libraries like ImageMagick or others - just like many large scale commercial services. Thank you.

Ok, thanks for the heads up @mariobehling.
I was not aware.
@free4murad please try to use any alternative open source solution as Mario
suggested instead of using rsz.io

On Sunday, March 12, 2017, Mario Behling notifications@github.com wrote:

@the-dagger https://github.com/the-dagger rsz.io is not Open Source as
far as I can see. Also, we want to ensure that the Android builder can work
potentially as a commercial service. Depending on third-parties that are
neither Open Source nor provide a commercial service, that we can rely on
is not a good idea. Please do not use rsz.io and do not merge PRs with
rsz.io or similar services. Use existing Open Source libraries like
ImageMagick or others - just like many large scale commercial services.
Thank you.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-android/issues/1264#issuecomment-285951018,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGQtlr7RqgqVKEHUsH00siYY2NJ7nmoIks5rlAtvgaJpZM4MWrtW
.

--
Best,
Harshit Dwivedi

Some of the resources mentioned here will help -

https://github.com/adamdbradley/foresight.js/wiki/Server-Resizing-Images

I coded a quick solution for it. Please take a look and test if it fulfills the requirements

https://github.com/iamareebjamal/resizr

Actually I myself started writing an API for this.
I will complete in a day.
I was planning to use that

OK :+1:

@free4murad status?

I am working on# 1244
Will send a PR asap

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gogeta95 picture gogeta95  Â·  7Comments

harshitagupta30 picture harshitagupta30  Â·  8Comments

PareshMayani picture PareshMayani  Â·  5Comments

iamareebjamal picture iamareebjamal  Â·  7Comments

mahikaw picture mahikaw  Â·  7Comments