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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why force highest to be first in output? #17

Closed
chrisspiegl opened this issue Mar 26, 2023 · 4 comments
Closed

Why force highest to be first in output? #17

chrisspiegl opened this issue Mar 26, 2023 · 4 comments

Comments

@chrisspiegl
Copy link
Contributor

Hello, I just found this to calculate the aspect ratio of images to makes sure a suer selects a 16x9 or a 9x16 for upload.

However, I noticed that this library always puts whatever is the heigher value as the first in the output?

Aka:

160x90 => 16:9
90x160 => 16:9

Which is not correct and isn't very useful? Why not keep the order on the final output? Is there a reason that I am not aware of?

I understand it may be necessary for the gcd calculation, but not for the final output. I think there it makes more sense to use the initial height/width as they were input.

@Kikobeats
Copy link
Owner

Kikobeats commented Mar 26, 2023

Hello, I'm not using this library for a while – Can you send a PR for fixing that behavior?

@chrisspiegl
Copy link
Contributor Author

I submitted a pull request which should take care of all of this and make the library more as expected with the input parameters.

I also added tests to make sure the library now also understands vertical video resolutions and returns them correctly.

Kikobeats added a commit that referenced this issue Mar 28, 2023
Fix for #17: Add tests & support for vertical video resolutions + Formatting Fixes
@Kikobeats
Copy link
Owner

shipped at aspect-ratio@2.1.3 🎉

@chrisspiegl
Copy link
Contributor Author

Thanks for your fast support 👍 and the way you shipped this easily.

It's a small library but it's certainly usefull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants