Skip to content

Commit

Permalink
DATA-2827 Removes lazy suffix from input mime type (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaney committed Jul 19, 2024
1 parent be98e2d commit d016328
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/viam/media/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ class CameraMimeType(str, Enum):

@classmethod
def from_string(cls, value: str) -> Self:
return cls(value)
"""Return the mimetype from a string.
Args:
value (str): The mimetype as a string
Returns:
Self: The mimetype
"""
value_mime = value[:-5] if value.endswith("+lazy") else value # ViamImage lazy encodes by default
return cls(value_mime)

@classmethod
def from_proto(cls, format: Format.ValueType) -> "CameraMimeType":
Expand Down

0 comments on commit d016328

Please sign in to comment.