Skip to content

Commit

Permalink
Cast SignedShort to i16 instead of i32
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Jul 22, 2024
1 parent 36f8ee0 commit 1e3bcf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decoder/ifd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ impl Entry {
Type::SBYTE => Signed(i32::from(self.offset[0] as i8)),
Type::UNDEFINED => Byte(self.offset[0]),
Type::SHORT => Short(self.r(bo).read_u16()?),
Type::SSHORT => Signed(i32::from(self.r(bo).read_i16()?)),
Type::SSHORT => SignedShort(self.r(bo).read_i16()?),
Type::LONG => Unsigned(self.r(bo).read_u32()?),
Type::SLONG => Signed(self.r(bo).read_i32()?),
Type::FLOAT => Float(self.r(bo).read_f32()?),
Expand Down Expand Up @@ -509,7 +509,7 @@ impl Entry {
let mut r = self.r(bo);
let mut v = Vec::new();
for _ in 0..self.count {
v.push(Signed(i32::from(r.read_i16()?)));
v.push(SignedShort(r.read_i16()?));
}
return Ok(List(v));
}
Expand Down

0 comments on commit 1e3bcf2

Please sign in to comment.