GovLab / noi2

The Network of Innovators website.
http://noi-demo.thegovlab.org/
4 stars 10 forks source link

Non-square avatar images appear distorted #111

Closed talos closed 8 years ago

talos commented 9 years ago

Scaling should be done along the smaller axis, resulting in a cropped instead of distorted image.

toolness commented 9 years ago

@claudioccm, is there any way to deal with this purely through CSS, or is the only way to address this issue by making the image square on the server-side/via JS Canvas code?

toolness commented 9 years ago

Hmm, I'm not actually convinced that scaling non-square profile pictures without distortion is actually the right solution here, since it means that we'll be cropping out part of the picture, which is still quite likely to make the avatar not look how the user expects/wants it to.

I think the ideal solution here is to do what most social sites do, which is to provide a UI that lets the user crop the picture themselves. However, since we don't have time to do that, I added some client-side code in 1f72952b3a5f7508ba38f9efabfc992304eb6c0f that at least helps ensure that the uploaded image is square.

toolness commented 8 years ago

This has basically been fixed by #224.