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

Added ability to create and edit color tables. #314

Merged
merged 8 commits into from Oct 5, 2022

Conversation

metasim
Copy link
Contributor

@metasim metasim commented Sep 28, 2022

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

image

an existing file, which seems to have race-condition issues on Linux.
src/dataset.rs Show resolved Hide resolved
src/dataset.rs Outdated Show resolved Hide resolved
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
end_index: u8,
end_color: &ColorEntry,
) -> Result<ColorTable<'a>> {
if start_color.palette_interpretation() != end_color.palette_interpretation() {
Copy link
Member

Choose a reason for hiding this comment

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

I might be wrong, but it feels like this might just as well be an assert_eq!, since it's a user error to pass in different types of entries.

But it's fine to leave it like this, if there's prior art or you think it's more user-friendly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I lean toward not panic!-ing on behalf of the user whenever possible. If they want to unwrap and get a panic! that's their business, but rather give them the option to handle it more gracefully if they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I would have rather done is make it a compile error :) But that's a rabbit hole.

src/raster/rasterband.rs Outdated Show resolved Hide resolved
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
@metasim
Copy link
Contributor Author

metasim commented Oct 5, 2022

bors r=lnicola

@bors
Copy link
Contributor

bors bot commented Oct 5, 2022

Build succeeded:

@bors bors bot merged commit 4c12c02 into georust:master Oct 5, 2022
@metasim metasim deleted the feature/color-table branch October 6, 2022 01:32
@metasim metasim mentioned this pull request Oct 6, 2022
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.

None yet

2 participants