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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Bug Report: getFlag aspect ratio / wrong rendering #3082
Comments
Issue resolved with PR mentioned above. (check it out, there are pictures 馃槷) Let's keep this issue open until we get the PR merged and ready for release. |
Actually this is the expected behavior. By default, the API crop the image and both default values for width and height are set to 100. To get the automatically calculate relative value, you just need to set |
Interesting, thanks. That works! But I'm curious, shouldn't this be the default behavior? |
If we set both values to 0, you will get the original images size by default which in most cases is far from the optimized resolution for your app or website. By setting the default to 100x100 we make developers aware of this feature to better use it and have better performance. |
Wouldn't it be better to just set the height to 100 as default and width to 0? |
It will probably not matter as much, but for consistency with other endpoints, and for us to not assume what's better width vs height, I think leaving it as is should be fine. |
That said, @Meldiron is updating the docs to make it more clear. |
Okay. That's a good idea. |
This feature is now released and available as part of Appwrite 0.14. More on the new release here: #3240 |
馃憻 Reproduction steps
I used the
/v1/avatars/flags/
endpoint and got not expected results. See results below:馃憤 Expected behavior
Return the right aspect ratio of the flag like in the files itself (https://github.com/appwrite/appwrite/blob/master/app/config/avatars/flags/de.png)
How to fix it: calculate the right (missing) width / height, especially because they're optional.
馃憥 Actual Behavior
/v1/avatars/flags/de
/v1/avatars/flags/de?height=25
/v1/avatars/flags/de?width=50
/v1/avatars/flags/de?width=200
馃幉 Appwrite version
Version 0.13.x
馃捇 Operating system
Linux
馃П Your Environment
I use nginx as a reverse proxy.
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: