Skip to content

Commit

Permalink
Cast SignedByte to i8 instead of i32
Browse files Browse the repository at this point in the history
Also handle casting of SignedByte (i8) into other signed types.
  • Loading branch information
weiji14 committed Jul 22, 2024
1 parent 9fee8f6 commit dd783c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decoder/ifd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl Entry {
// 2b: the value is at most 4 bytes or doesn't fit in the offset field.
return Ok(match self.type_ {
Type::BYTE => Byte(self.offset[0]),
Type::SBYTE => Signed(i32::from(self.offset[0] as i8)),
Type::SBYTE => SignedByte(i8::from(self.offset[0] as i8)),
Type::UNDEFINED => Byte(self.offset[0]),
Type::SHORT => Unsigned(u32::from(self.r(bo).read_u16()?)),
Type::SSHORT => Signed(i32::from(self.r(bo).read_i16()?)),
Expand Down

0 comments on commit dd783c3

Please sign in to comment.