Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DirSortReport ¶ added in v1.0.0
type DirSortReport struct { // number of images processed. Imgs int // map of unprocessed files and the error message. Unprocessed map[string]string }
DirSortReport holds information about the sort directory proccess
func NewDirSortReport ¶ added in v1.0.0
func NewDirSortReport() *DirSortReport
NewDirSortReport creates a new DirSortReport with default values.
func SortDir ¶
func SortDir(src string, dst string, format string) (*DirSortReport, error)
SortDir sorts the files in the specified source directory and saves them to the destination directory.
Only files with the .jpg extension will be processed. The function returns a report with the elapsed time, number of images processed, and a map of unprocessed files and the error message.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represents an image file and holds original creation time from metadata.
func NewImage ¶
NewImage reads the content of an image file from the file system, extracts the EXIF metadata from the file, parses the EXIF metadata to extract the original creation time of the image, and then returns an *Image struct containing the image data, file path, and original creation time.
Returns an error if any of the steps in this process fail, such as if the file cannot be read, if the EXIF metadata cannot be extracted or parsed, or if the original creation time cannot be extracted from the EXIF metadata.