From 84ff6795e0400305ce86478d5b200b2350457479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=98gaard?= Date: Wed, 6 Sep 2023 11:09:01 +0200 Subject: [PATCH] short_fix --- src/decoder/ifd.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decoder/ifd.rs b/src/decoder/ifd.rs index ecba47fe..2b7ef54d 100644 --- a/src/decoder/ifd.rs +++ b/src/decoder/ifd.rs @@ -257,7 +257,8 @@ impl Value { new_vec.push(v.into_u64()?) } Ok(new_vec) - } + }, + Short(val) => Ok(vec![val.into()]), Unsigned(val) => Ok(vec![val.into()]), UnsignedBig(val) => Ok(vec![val]), Rational(numerator, denominator) => Ok(vec![numerator.into(), denominator.into()]), @@ -404,7 +405,7 @@ impl Entry { Type::BYTE => Unsigned(u32::from(self.offset[0])), Type::SBYTE => Signed(i32::from(self.offset[0] as i8)), Type::UNDEFINED => Byte(self.offset[0]), - Type::SHORT => Unsigned(u32::from(self.r(bo).read_u16()?)), + Type::SHORT => Short(u16::from(self.r(bo).read_u16()?)), Type::SSHORT => Signed(i32::from(self.r(bo).read_i16()?)), Type::LONG => Unsigned(self.r(bo).read_u32()?), Type::SLONG => Signed(self.r(bo).read_i32()?),