From 4c58c1c84b6691bbe49dcae09c0289c39c7af02d Mon Sep 17 00:00:00 2001 From: Dustin Oprea Date: Wed, 6 Jun 2018 05:17:56 -0400 Subject: [PATCH] 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). --- exif.go | 4 ---- exif_test.go | 2 +- ifd_builder_encode_test.go | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/exif.go b/exif.go index 2578ae6..bfefa24 100644 --- a/exif.go +++ b/exif.go @@ -17,10 +17,6 @@ const ( // offsets are relative to. 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 // 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 diff --git a/exif_test.go b/exif_test.go index 84e1a35..45843e3 100644 --- a/exif_test.go +++ b/exif_test.go @@ -234,7 +234,7 @@ func TestCollect(t *testing.T) { tree := index.Tree lookup := index.Lookup - if rootIfd.Offset != RootIfdExifOffset { + if rootIfd.Offset != uint32(0x0008) { t.Fatalf("Root-IFD not correct: (0x%04d).", rootIfd.Offset) } else if rootIfd.Id != 0 { t.Fatalf("Root-IFD does not have the right ID: (%d)", rootIfd.Id) diff --git a/ifd_builder_encode_test.go b/ifd_builder_encode_test.go index 09dbb7a..ae89761 100644 --- a/ifd_builder_encode_test.go +++ b/ifd_builder_encode_test.go @@ -537,7 +537,7 @@ func validateExifSimpleTestIb(exifData []byte, t *testing.T) { t.Fatalf("IFD name not correct.") } else if ifd.Index != 0 { 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.") } else if len(ifd.Entries) != 4 { t.Fatalf("IFD number of entries not correct: (%d)", len(ifd.Entries))