-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve images based on aspect ratio query #458
Comments
corresponding issue over on the foundation repo: MozillaFoundation/foundation.mozilla.org#2687 |
Depending on the "physical" size we need, we might be able to do some python resizing magic, and send the profile headshots over as base64 strings as part of the API response, or we might be able to set up a dedicated API route for headshot images that we can call based on an id, like |
Headshots would be 192x192 x1, 384x384 x2, so that would pack on probably about 10kb in compressed JPG per profile - that makes it impractical to add it as BASE64 string in the API response itself, but makes it quite suited for serving up as dedicated API response on a @alanmoo API responses already tie profile ids to headshot URLs, would there any privacy concerns over also having a dedicated "just the headshot" route? |
I'm also not entirely sure whether this is a thing we can easily do, if the API server itself just deals with the metadata. I'm sure we don't want the API server to also become an image proxy, so we'll have to think about how best to get images resized in a way that doesn't bog down the API server itself. |
We were discussing this issue with @cadecairos and it reminded me of that: https://github.com/codingjoe/django-stdimage. It sounds pretty cool and we could use this https://github.com/glemmaPaul/django-stdimage-serializer/blob/master/stdimage_serializer/fields.py as a prototype to build our own serializer. |
Oh wow, that definitely looks pretty cool, let's see how far that gets us! |
@Pomax am I able to just install and use the |
Closing this issue due to having gone stale - if this is still something we want to do, let's file a new issue with all the information necessary for triaging. |
The API needs to be capable of serving optimized, uploaded images to specific aspect ratios/dimensions based on a query parameter.
Use-case: Currently on the foundation site, I am trying to render Fellow images from Pulse at a 1:1 aspect ratio, but the current system doesn't allow me to do that solely with the URL that is being served.
cc: @patjouk
The text was updated successfully, but these errors were encountered: