func NewGooglePhotoMetadata(picFilePath string, matchLivePhotos bool) (*GooglePhotoMetadata, string, error) {
	log.Println("[DEBUG] Looking for metadata for", picFilePath)
	result := GooglePhotoMetadata{}
	metadataFilePaths := getMetadataFilenames(picFilePath, matchLivePhotos)
	var err error = nil
	var metadataFilePath string = "(no Google metadata file path found)"
	if isMetadataUnamgibuous(picFilePath, metadataFilePaths) {
		var file []byte
		for _, metadataFilePath = range metadataFilePaths {
			file, err = ioutil.ReadFile(metadataFilePath)
			if err == nil {
				err = json.Unmarshal(file, &result)
				if err != nil {
					log.Println("[WARN] Failed to unmarshal Google metadata file:", metadataFilePath, err)
					return nil, metadataFilePath, err
				}
				log.Println("[DEBUG] Using Google metadata file:", metadataFilePath)
				log.Println("[DEBUG]", picFilePath, "IsTrashed:", result.IsTrashed, "PhotoTakenTime:", result.PhotoTakenTime)

				return &result, metadataFilePath, nil
			}
		}
	} else {
		log.Println("[WARN] Skipping Google metadata for", picFilePath, "because it could not be matched to the file with full confidence.")
	}
	return nil, metadataFilePath, err
}
// NewGooglePhotoMetadata creates a new metadata instance from the given picture filename.  The convention is <picname>.json
NewGooglePhotoMetadata creates a new metadata instance from the given picture filename.  The convention is .json
// NewGooglePhotoMetadata creates a new metadata instance from the given picture filename . The convention is <picname > . json
func NewGooglePhotoMetadata(picFilePath string, matchLivePhotos bool) (*GooglePhotoMetadata, string, error) {
	log.Println("[DEBUG] Looking for metadata for", picFilePath)
	result := GooglePhotoMetadata{}
	metadataFilePaths := getMetadataFilenames(picFilePath, matchLivePhotos)
	var err error = nil
	var metadataFilePath string = "(no Google metadata file path found)"
	if isMetadataUnamgibuous(picFilePath, metadataFilePaths) {
		var file []byte
		for _, metadataFilePath = range metadataFilePaths {
			file, err = ioutil.ReadFile(metadataFilePath)
			if err == nil {
				err = json.Unmarshal(file, &result)
				if err != nil {
					log.Println("[WARN] Failed to unmarshal Google metadata file:", metadataFilePath, err)
					return nil, metadataFilePath, err
				}
				log.Println("[DEBUG] Using Google metadata file:", metadataFilePath)
				log.Println("[DEBUG]", picFilePath, "IsTrashed:", result.IsTrashed, "PhotoTakenTime:", result.PhotoTakenTime)
				return &result, metadataFilePath, nil
			}
		}
	} else {
		log.Println("[WARN] Skipping Google metadata for", picFilePath, "because it could not be matched to the file with full confidence.")
	}
	return nil, metadataFilePath, err
}
func NewGooglePhotoMetadata ( picFilePath string , matchLivePhotos bool ) ( * GooglePhotoMetadata , string , error ) { log . Println ( " " , picFilePath ) result := GooglePhotoMetadata { } metadataFilePaths := getMetadataFilenames ( picFilePath , matchLivePhotos ) var err error = nil var metadataFilePath string = " " if isMetadataUnamgibuous ( picFilePath , metadataFilePaths ) { var file [ ] byte for _ , metadataFilePath = range metadataFilePaths { file , err = ioutil . ReadFile ( metadataFilePath ) if err == nil { err = json . Unmarshal ( file , & result ) if err != nil { log . Println ( " " , metadataFilePath , err ) return nil , metadataFilePath , err } log . Println ( " " , metadataFilePath ) log . Println ( " " , picFilePath , " " , result . IsTrashed , " " , result . PhotoTakenTime ) return & result , metadataFilePath , nil } } } else { log . Println ( " " , picFilePath , " " ) } return nil , metadataFilePath , err }
NewGooglePhotoMetadata creates a new metadata instance from the given picture filename.
NewGooglePhotoMetadata creates a new metadata instance from the given picture filename .