Skip to content

Read SignedShort as i16, add TiffFormatError::ShortExpected #94

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 9 commits into from
May 7, 2025

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented May 5, 2025

What I am changing

  • Ensuring SignedShort -> i16 and Short -> u16

How I did it

  • Add TiffFormatError::ShortExpected enum variant
  • Support casting Short to other unsigned types via the into_u32_vec and into_u64_vec methods.
  • Correctly cast Type::SSHORT as i16 values

How you can test it

  • Run cargo test locally.

Related Issues

@weiji14 weiji14 added the bug Something isn't working label May 5, 2025
@weiji14 weiji14 self-assigned this May 5, 2025
@weiji14 weiji14 marked this pull request as ready for review May 5, 2025 03:24
Comment on lines 662 to 663
([1,1, 8, 0, 1,0,0,0, 42, 0, 0, 0], Endianness::LittleEndian, Value::SignedShort (42 )), // signedshort
([1,1, 0, 8, 0,0,0,1, 0,42, 0, 0], Endianness::BigEndian, Value::SignedShort (42 )), // signedshort
Copy link
Member

Choose a reason for hiding this comment

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

Remove comments?

Copy link
Member Author

@weiji14 weiji14 May 7, 2025

Choose a reason for hiding this comment

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

All done at commit 098e756

@weiji14 weiji14 merged commit b13d259 into main May 7, 2025
@weiji14 weiji14 deleted the sshort_i16 branch May 7, 2025 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants