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

feat!: Fetch full-size source image for accurate aspect ratio #4

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

decepulis
Copy link
Contributor

@decepulis decepulis commented Dec 13, 2024

BREAKING CHANGE: returned props width and height now return the original unresized thumbnail dimensions from Mux.

closes #3

This PR fetches the full-size image from Mux and measures it for width, height, and aspectRatio

This is a potentially breaking change; authors who expect small widths and heights <= 16 may be surprised. I considered making this an additive change, with new sourceWidth, sourceHeight, and sourceAspectRatio return values, but considering 1) the v0.x.x versioning and 2) the original intent of the width, height, and aspectRatio values, I consider this to be the right move.

This PR also makes an unrelated change:
Previously, this library would fetch the full-size image if quality < 1. Now, it errors if quality <= 0, which I believe might've been the original intent of that line.

Looking forward to hearing what you think!

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blurup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:32pm

blurup.js Outdated Show resolved Hide resolved
blurup.js Outdated Show resolved Hide resolved
blurup.js Outdated Show resolved Hide resolved
@decepulis
Copy link
Contributor Author

decepulis commented Dec 13, 2024

@luwes comments addressed, thanks for the feedback!

@luwes luwes changed the title Fetch full-size source image for accurate aspect ratio feat!: Fetch full-size source image for accurate aspect ratio Dec 13, 2024
Copy link
Collaborator

@luwes luwes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I updated the PR title and description so it bumps the major version. lets make this the v1 then 🎉

@luwes luwes merged commit 41356e7 into muxinc:main Dec 13, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

inaccurate aspect-ratio
2 participants