Skip to content

Conversation

njooma
Copy link
Member

@njooma njooma commented May 26, 2023

When the mime type is empty on a camera.get_image request, python was sending back an empty mime type instead of choosing a default mime type.

I basically copied what's going on in RDK, which I saw @kharijarrett implemented, so tagging him as a reviewer.

Cc: @thegreatco this should help with oakd

@njooma njooma requested a review from kharijarrett May 26, 2023 21:07
@njooma njooma requested a review from a team as a code owner May 26, 2023 21:07
@njooma njooma requested review from clintpurser and cheukt May 26, 2023 21:07
else:
self._camera_mime_types[camera.name] = CameraMimeType.JPEG

request.mime_type = self._camera_mime_types[camera.name]
Copy link
Member

Choose a reason for hiding this comment

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

Okay so I'm not sure if we want to do any of this client side (is this client side lol?). The idea is that an empty request should be able to slide past. The server side should determine the mime type using logic like ^^ (like in RDK). I guess my question is why would we choose the request mimetype and not the response?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kharijarrett this is the server side but in python. So if someone is making a modular camera in python, rpc requests coming to that module would hit this code.

Copy link
Member

Choose a reason for hiding this comment

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

Makes all the difference in the world lol this LGTM!

@njooma njooma merged commit f76c39a into viamrobotics:main May 30, 2023
@njooma njooma deleted the default-mime-type branch May 30, 2023 21:38
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