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

Byte array instead of file as input #9

Closed
robinvanemden opened this issue Jul 31, 2020 · 2 comments
Closed

Byte array instead of file as input #9

robinvanemden opened this issue Jul 31, 2020 · 2 comments
Labels

Comments

@robinvanemden
Copy link

First of all, thanks for making this library available! For a project of mine, I am already succesfully using it to load images. But now I need also need to decode a uint8_t based byte array directly. Do you have a suggestion how you would go about that using your library?

@brackeen
Copy link
Owner

You can use ok_png_read_from_input to read from any input source. So in the case of a byte array, the ok_png_input.read function would copy data and increment the read position, and ok_png_input.seek would just increment the read position.

@robinvanemden
Copy link
Author

Super! Thanks for your fast reply.

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

No branches or pull requests

2 participants