Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileExif ¶
FileExif data store for exif data
func (*FileExif) ReadALLDataAsJSON ¶
ReadALLDataAsJSON read data from exif metadata and set to our datastore
Example ¶
var file = "./textRotate.jpg" f, err := os.Open(file) if err != nil { log.Println(err) } defer f.Close() d := &FileExif{} d.Data = make(map[string]string) //d.ReadALLDataAsJSON(f) Use to find fields keys := make([]exif.FieldName, 0) keys = append(keys, exif.FocalLength) keys = append(keys, exif.PixelXDimension) keys = append(keys, exif.PixelYDimension) keys = append(keys, exif.ExifVersion) keys = append(keys, exif.ThumbJPEGInterchangeFormat) keys = append(keys, exif.ThumbJPEGInterchangeFormatLength) keys = append(keys, exif.Model) keys = append(keys, exif.Make) keys = append(keys, exif.Flash) keys = append(keys, exif.ExposureTime) keys = append(keys, exif.DigitalZoomRatio) keys = append(keys, exif.DateTimeOriginal) keys = append(keys, exif.DateTime) keys = append(keys, exif.DateTimeDigitized) err = d.ReadDataByKey(f, keys) if err != nil { log.Printf("ERROR: issue reading by key\n%+v\n", err) } //w x h t := ioimage.NewImageMeta() w, h, imgtype := t.Dimensions(file) log.Printf("W: %d, H: %d Type: %s\n", w, h, imgtype) log.Println("print data found") for k, v := range d.Data { log.Println(k, ":", v) } //log.Println(d.JSONData) //log.Println("") /* Output: hi */ */
Output: hi
func (*FileExif) ReadDataByKey ¶
ReadDataByKey find data by key exif.FocalLength exif.PixelXDimension exif.PixelYDimension exif.ExifVersion exif.ThumbJPEGInterchangeFormat exif.ThumbJPEGInterchangeFormatLength exif.Model exif.Make exif.Flash exif.ExposureTime exif.DigitalZoomRatio
func (*FileExif) ReadLatLongData ¶
ReadLatLongData find lat/long data and return
Click to show internal directories.
Click to hide internal directories.