Skip to content

Return Uint8Array image from captureAllFromCamera #342

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

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

micheal-parks
Copy link
Member

Overview

Currently captureAllFromCamera returns a base64 encoded image from captureAllFromCamera. This PR updates the method implementation so that a more efficient Uint8Array is returned instead.

Comment on lines +198 to +200
format: image.getFormat(),
sourceName: image.getSourceName(),
image: image.getImage_asU8(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the return value of this function strictly typed? If so, all good. If not, this image response could drift if someone changed the image definition (e.g. added a new field to Image)

Copy link
Member Author

@micheal-parks micheal-parks Aug 27, 2024

Choose a reason for hiding this comment

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

It is, it's following the definition of Image and a return type error will be thrown by TSC if it doesn't adhere to it.

@micheal-parks
Copy link
Member Author

Just to add a little extra clarification: this is correcting a problem with the original implementation and aligning behavior with the go and python SDKs. Additionally this will help performance with a part of app that a potential customer is looking at. @stuqdog happen to know who would be a good reviewer on your team? Thanks in advance for any help!

@micheal-parks
Copy link
Member Author

Thanks @njooma!

@micheal-parks micheal-parks merged commit 65b0fdb into viamrobotics:main Aug 28, 2024
3 checks passed
@micheal-parks micheal-parks deleted the capture-cam branch August 28, 2024 16:34
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.

3 participants