205stelzear / elections

Website / Webapp to create and view elections for any Scout group
https://205stelzear-elections.v-ed.ca/
MIT License
0 stars 0 forks source link

Investigate possibility of adding photos for each candidate #76

Open V-ed opened 4 years ago

V-ed commented 4 years ago

While it would mean that the data would be much bigger, and woud bring a much bigger load on my server, the idea that there could be a way to quickly visually know what does the candidate looks like is rather interesting.

The main issue about this is how much should I restrain image sizes. This is important since the quickest way to have these photos ready would be to take them on the spot, but photos taken by phones nowadays could easily reach 3+MB (a single photo taken from my phone is about 3.6MB).

If this is to be implemented, I would need to research about compression algorithms available for javascript, keeping the best quality while only allowing a max size for loads.

This also means that my server will need to accept a max 2MB logo and max 2MB * n candidates images (n being the number of candidates added). This means I have absolutely no idea how many photos will be in the request.

This also means that my server will be downloading probably 20MB of data on election creation, and serving 20MB of data for every new device that joins the election... while it is an acceptable margin of maneuver, I'm still not convinced this is a great idea...


Also, there is currently a use case where you can take a picture of every candidates one next to each other in order that they are entered in the setup, and use this photo as the group logo, meaning the image will be on top and useful for knowing who is who.


Finally, I would need to implement for this an image viewer widget to the voting page, so that you can see the image in full size to not have too small devices not be able to show the image big enough.

V-ed commented 4 years ago

Possible solution to scaling images locally : https://stackoverflow.com/a/43441441

V-ed commented 4 years ago

Interesting idea to put a button next to the candidate to take a photo on the page : https://stackoverflow.com/q/17004981