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

Add a utility function to report if payload will fit into image before encoding #49

Open
nervetrip opened this issue Oct 26, 2024 · 1 comment

Comments

@nervetrip
Copy link

nervetrip commented Oct 26, 2024

Would it be possible to add a utility function that would report if a given payload will fit inside a given image? Perhaps it could even report how many copies of it would fit?

I've found that larger payloads will sometimes error out when encoding into an image. I'm currently catching that error, reducing the number of copies, and then encoding again. It seems like doing some simple checks up front would be more optimal.

Perhaps there may be other information that might be useful before attempting to encode, but I'm not sure what that might be as I'm not too familiar with this library yet.

@Jack-Works
Copy link
Member

yes, it is possible but needs some math, maybe the initial developer can help cc @guanbinrui

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