Re: [go-nuts] binary.Read()

2017-10-07 Thread Johan terryn
> On Thu, Oct 5, 2017 at 9:10 PM Johan terryn > wrote: > > > Here is the full (trimmed) working program: > > The program compiles just fine (https://play.golang.org/p/Xg3qlovrzg), > where is the problem? > > -- > > -j > -- You received this message beca

Re: [go-nuts] binary.Read()

2017-10-05 Thread Johan terryn
fmt.Printf("Exif %s\n", string(header.ExifTxt[:4])) fmt.Printf("Intel Encoding %t\n", string(header.ExifEncoding[:2]) == ExifEncoding) } } return nil } func main() { readFile("image.JPG") } On Thursday, Octob

[go-nuts] binary.Read()

2017-10-05 Thread Johan terryn
In following code: type JPGFile struct { Exif_SOI [2]byte Exif } type Exif struct {APP1Marker [2]byteAPP1DataSize uint16ExifHeader [6]byteTIFFHeader[6]byte} func ReadFile(filename string) (JPGFile, error) { jpgFile := JPGFile{} in, err := os.Open(fil