Skip to content

Read Byte as u8, SignedByte as i8 #236

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

Merged
merged 4 commits into from
Jun 9, 2025

Conversation

weiji14
Copy link
Contributor

@weiji14 weiji14 commented Jul 22, 2024

Previously, Byte values were read incorrectly as u32 instead of u8, and SignedShort values were read incorrectly as i32 instead of i8.

This PR does the following:

  • Correctly cast Type::BYTE as u8 values, and support casting Byte to other unsigned types via into_u16, into_u32, into_u64, into_u16_vec, into_u32_vec, and into_u64_vec methods.
  • Correctly cast Type::SBYTE as i8 values

Similar to #235, resolves some inconsistencies raised in #204.

weiji14 added 3 commits July 22, 2024 19:22
Also handle casting of Byte (u8) into other unsigned types.
Also handle casting of SignedByte (i8) into other signed types.
@weiji14 weiji14 marked this pull request as ready for review June 9, 2025 01:30
@fintelia fintelia merged commit ee0dbf3 into image-rs:master Jun 9, 2025
6 checks passed
@weiji14 weiji14 deleted the byte_u8_sbyte_i8 branch June 9, 2025 01:37
@weiji14
Copy link
Contributor Author

weiji14 commented Jun 9, 2025

Thanks @fintelia!

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.

2 participants