y20k / transistor

Transistor - Simple Radio App for Android
http://y20k.org/transistor/
MIT License
437 stars 121 forks source link

Reduce collection data about 50% than before, becuase station-image-s… #327

Closed jamal2362 closed 3 years ago

jamal2362 commented 3 years ago

…mall.jpg is the same than station-image.jpg.

A duplicate of the image is not necessary and only costs the storage space of the device.

And it is also good/better for the performance.

y20k commented 3 years ago

station-image-small.jpg is the same than station-image.jpg

This is/was actually on purpose. Transistor prepares two sizes of the station image in advance.

When the app is creating the list, small images (should) help to keep the memory footprint small: Before an image is put in the list the source JPG file is (a) decoded internally and then (b) resized. Decoded JPGs are usually much bigger than the original file. But that's all my theory, I actually do not know how the list feature works internally :-)

As for the image size: the small images should not take up much space on a device. ~9 kb per image on my device. That seems / seemed to be absolutely tolerable given the likely effect on memory usage.

jamal2362 commented 3 years ago

Hi

Thank you very much for the feedback. Now I know what the meaning behind this function is.

I made this pull request because I noticed that there are 2 images in the collection that are exactly the same and I thought that I could save one image.

Greetings Jamal