use int32 instead of int when parsing

This commit is contained in:
Kory Prince 2020-07-27 16:03:43 -05:00
parent 03af72ab48
commit 7f05f5e6b0
1 changed files with 5 additions and 5 deletions

View File

@ -351,8 +351,8 @@ type Attribute struct {
// Resolution defines the resolution attribute // Resolution defines the resolution attribute
type Resolution struct { type Resolution struct {
Height int Height int32
Width int Width int32
Depth int8 Depth int8
} }
@ -480,7 +480,7 @@ func (d *AttributeDecoder) decodeDate() ([]int, error) {
return is, nil return is, nil
} }
func (d *AttributeDecoder) decodeRange() ([]int, error) { func (d *AttributeDecoder) decodeRange() ([]int32, error) {
length, err := d.readValueLength() length, err := d.readValueLength()
if err != nil { if err != nil {
return nil, err return nil, err
@ -488,10 +488,10 @@ func (d *AttributeDecoder) decodeRange() ([]int, error) {
// initialize range element count (c) and range slice (r) // initialize range element count (c) and range slice (r)
c := length / 4 c := length / 4
r := make([]int, c) r := make([]int32, c)
for i := int16(0); i < c; i++ { for i := int16(0); i < c; i++ {
var ti int var ti int32
if err = binary.Read(d.reader, binary.BigEndian, &ti); err != nil { if err = binary.Read(d.reader, binary.BigEndian, &ti); err != nil {
return nil, err return nil, err
} }