Skip to content
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

Closed
2 tasks done
XeroxDev opened this issue Apr 11, 2022 · 10 comments
Closed
2 tasks done

馃悰 Bug Report: getFlag aspect ratio / wrong rendering #3082

XeroxDev opened this issue Apr 11, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@XeroxDev
Copy link

馃憻 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
image

/v1/avatars/flags/de?height=25
image

/v1/avatars/flags/de?width=50
image

/v1/avatars/flags/de?width=200
image

馃幉 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?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@XeroxDev XeroxDev added the bug Something isn't working label Apr 11, 2022
@christyjacob4
Copy link
Member

@XeroxDev thanks for raising this issue.
@Meldiron Please take a look at the image library

@Meldiron
Copy link
Contributor

Meldiron commented Apr 12, 2022

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.

@eldadfux
Copy link
Member

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 0 for one of the params.

@XeroxDev
Copy link
Author

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 0 for one of the params.

Interesting, thanks. That works! But I'm curious, shouldn't this be the default behavior?

@eldadfux
Copy link
Member

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.

@XeroxDev
Copy link
Author

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?

@eldadfux
Copy link
Member

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.

@eldadfux
Copy link
Member

That said, @Meldiron is updating the docs to make it more clear.

@XeroxDev
Copy link
Author

Okay. That's a good idea.

@Meldiron Meldiron added the waiting for release Fixed or implemented and waiting for a new version to be released label Apr 29, 2022
@eldadfux
Copy link
Member

This feature is now released and available as part of Appwrite 0.14. More on the new release here: #3240

@eldadfux eldadfux removed the waiting for release Fixed or implemented and waiting for a new version to be released label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants