mirror of https://github.com/dsoprea/go-exif.git
exif: Eliminated an offset constant. Just used for tests.
- Will simplify fixing the header issues we have. It's relative, any way (won't be affected by the imminent changes to the header).pull/3/head
parent
1d7239382b
commit
4c58c1c84b
4
exif.go
4
exif.go
|
@ -17,10 +17,6 @@ const (
|
||||||
// offsets are relative to.
|
// offsets are relative to.
|
||||||
ExifAddressableAreaStart = uint32(0x6)
|
ExifAddressableAreaStart = uint32(0x6)
|
||||||
|
|
||||||
// RootIfdExifOffset is the relative offset of the first IFD in the block
|
|
||||||
// of EXIF data.
|
|
||||||
RootIfdExifOffset = uint32(0x0008)
|
|
||||||
|
|
||||||
// ExifDefaultFirstIfdOffset is essentially the number of bytes in addition
|
// ExifDefaultFirstIfdOffset is essentially the number of bytes in addition
|
||||||
// to `ExifAddressableAreaStart` that you have to move in order to escape
|
// to `ExifAddressableAreaStart` that you have to move in order to escape
|
||||||
// the rest of the header and get to the earliest point where we can put
|
// the rest of the header and get to the earliest point where we can put
|
||||||
|
|
|
@ -234,7 +234,7 @@ func TestCollect(t *testing.T) {
|
||||||
tree := index.Tree
|
tree := index.Tree
|
||||||
lookup := index.Lookup
|
lookup := index.Lookup
|
||||||
|
|
||||||
if rootIfd.Offset != RootIfdExifOffset {
|
if rootIfd.Offset != uint32(0x0008) {
|
||||||
t.Fatalf("Root-IFD not correct: (0x%04d).", rootIfd.Offset)
|
t.Fatalf("Root-IFD not correct: (0x%04d).", rootIfd.Offset)
|
||||||
} else if rootIfd.Id != 0 {
|
} else if rootIfd.Id != 0 {
|
||||||
t.Fatalf("Root-IFD does not have the right ID: (%d)", rootIfd.Id)
|
t.Fatalf("Root-IFD does not have the right ID: (%d)", rootIfd.Id)
|
||||||
|
|
|
@ -537,7 +537,7 @@ func validateExifSimpleTestIb(exifData []byte, t *testing.T) {
|
||||||
t.Fatalf("IFD name not correct.")
|
t.Fatalf("IFD name not correct.")
|
||||||
} else if ifd.Index != 0 {
|
} else if ifd.Index != 0 {
|
||||||
t.Fatalf("IFD index not zero: (%d)", ifd.Index)
|
t.Fatalf("IFD index not zero: (%d)", ifd.Index)
|
||||||
} else if ifd.Offset != RootIfdExifOffset {
|
} else if ifd.Offset != uint32(0x0008) {
|
||||||
t.Fatalf("IFD offset not correct.")
|
t.Fatalf("IFD offset not correct.")
|
||||||
} else if len(ifd.Entries) != 4 {
|
} else if len(ifd.Entries) != 4 {
|
||||||
t.Fatalf("IFD number of entries not correct: (%d)", len(ifd.Entries))
|
t.Fatalf("IFD number of entries not correct: (%d)", len(ifd.Entries))
|
||||||
|
|
Loading…
Reference in New Issue