-
Notifications
You must be signed in to change notification settings - Fork 113
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
RSDK-2077 Make sure custom depth type is big endian encoded #1984
RSDK-2077 Make sure custom depth type is big endian encoded #1984
Conversation
|
||
rawWidth, err := _readNext(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_readNext is coded to read in LittleEndian byte order, so for backwards compatbility with .dat and .dat.gz files, we can keep it. We replace the Viam Depth type to read in BigEndian order
buf := bytes.Buffer{} | ||
err = m.WriteToBuf(&buf) | ||
test.That(t, err, test.ShouldBeNil) | ||
test.That(t, buf.Bytes(), test.ShouldNotBeNil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WriteToBuf writes a grayscale PNG
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Changes
vnd.viam.dep
to be encoded in a Big Endian way, as that is the network byte order, as used by the C++ server and on the Internet.