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

E57SimpleReader fails on reading uint16_t colours #159

Closed
asmaloney opened this issue Nov 1, 2022 · 1 comment · Fixed by #167
Closed

E57SimpleReader fails on reading uint16_t colours #159

asmaloney opened this issue Nov 1, 2022 · 1 comment · Fixed by #167
Labels
enhancement New feature or request

Comments

@asmaloney
Copy link
Owner

(This was reported by @ollira.)

The Data3DPointsData_t struct contains fields for colours as follows:

uint8_t *colorRed = nullptr;      //!< Pointer to a buffer with the Red color coefficient. Unit is unspecified
uint8_t *colorGreen = nullptr;    //!< Pointer to a buffer with the Green color coefficient. Unit is unspecified
uint8_t *colorBlue = nullptr;     //!< Pointer to a buffer with the Blue color coefficient. Unit is unspecified

When reading a file with colours stored as uint16_t, E57SimpleReader fails with an exception:

ERROR: **** Got an e57 exception: a value could not be represented in the requested type (E57_ERROR_VALUE_NOT_REPRESENTABLE)
  Debug info: 
    context: pathName=colorRed value=65280
    sourceFunctionName: e57::SourceDestBufferImpl::setNextInt64

This is because the implicit conversions don't know how to convert uint16_t to uint8_t.

While this seems to be "working as intended", it seems reasonable to change this so that E57SimpleReader can handle more variations.

The proposed solution is to change the fields in the Data3DPointsData_t struct to uint16_t. From an API standpoint, this would be a breaking change.

@asmaloney asmaloney added the enhancement New feature or request label Nov 1, 2022
@asmaloney
Copy link
Owner Author

I added an example file (ColourRepresentation.e57) from @ollira to the test data.

asmaloney added a commit that referenced this issue Nov 2, 2022
This allows us to use the E57Reader to read colours in las2e57-produced files.

Fixes #159
asmaloney added a commit that referenced this issue Nov 5, 2022
This allows us to use the E57Reader to read colours in las2e57-produced files.

Fixes #159
asmaloney added a commit that referenced this issue Nov 5, 2022
This allows us to use the E57Reader to read colours in las2e57-produced files.

Fixes #159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant