Documentation
¶
Index ¶
- func ExtractTimestampFromPath(path string) (time.Time, error)
- func GenerateTimestampedPath(originalPath string) string
- func GenerateTimestampedPathWithPrefix(originalPath, prefix string) string
- func GetOriginalFilename(timestampedPath string) string
- func IsTimestampedPath(path string) bool
- type EXIFData
- type NoOpOCRExtractor
- type OCRData
- type OCRExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTimestampFromPath ¶
ExtractTimestampFromPath extracts the timestamp from a timestamped path Returns zero time if the path doesn't have a valid timestamp
func GenerateTimestampedPath ¶
GenerateTimestampedPath generates a timestamped relative path for an image Format: YYYYMMDD_HHMMSS_microseconds_originalfilename.ext Example: 20251015_143052_123456_yorkshire-terrier.jpg
func GenerateTimestampedPathWithPrefix ¶
GenerateTimestampedPathWithPrefix generates a timestamped path with custom prefix
func GetOriginalFilename ¶
GetOriginalFilename extracts the original filename from a timestamped path
func IsTimestampedPath ¶
IsTimestampedPath checks if a path follows the timestamped format
Types ¶
type EXIFData ¶
type EXIFData struct {
Make string `json:"make,omitempty"`
Model string `json:"model,omitempty"`
DateTime string `json:"datetime,omitempty"`
Orientation int `json:"orientation,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
FNumber float64 `json:"f_number,omitempty"`
ExposureTime string `json:"exposure_time,omitempty"`
ISO int `json:"iso,omitempty"`
FocalLength string `json:"focal_length,omitempty"`
GPSLatitude float64 `json:"gps_latitude,omitempty"`
GPSLongitude float64 `json:"gps_longitude,omitempty"`
GPSAltitude float64 `json:"gps_altitude,omitempty"`
}
EXIFData represents extracted EXIF metadata
func ExtractEXIF ¶
ExtractEXIF extracts EXIF metadata from an image file
func ExtractEXIFFromBytes ¶
ExtractEXIFFromBytes extracts EXIF metadata from image bytes
type NoOpOCRExtractor ¶
type NoOpOCRExtractor struct{}
NoOpOCRExtractor provides a no-op implementation when Tesseract is not available
func (*NoOpOCRExtractor) ExtractFromBytes ¶
func (n *NoOpOCRExtractor) ExtractFromBytes(imageData []byte) (*OCRData, error)
ExtractFromBytes returns an error indicating OCR is not available
func (*NoOpOCRExtractor) ExtractFromFile ¶
func (n *NoOpOCRExtractor) ExtractFromFile(filePath string) (*OCRData, error)
ExtractFromFile returns an error indicating OCR is not available
func (*NoOpOCRExtractor) ExtractWithLanguage ¶
func (n *NoOpOCRExtractor) ExtractWithLanguage(filePath string, language string) (*OCRData, error)
ExtractWithLanguage returns an error indicating OCR is not available
type OCRData ¶
type OCRData struct {
Text string `json:"text"`
Confidence float64 `json:"confidence"`
Language string `json:"language"`
HasText bool `json:"has_text"`
}
OCRData represents extracted OCR text and confidence
func (*OCRData) GetTextSummary ¶
GetTextSummary returns a short summary of the OCR text
type OCRExtractor ¶
type OCRExtractor interface {
ExtractFromBytes(imageData []byte) (*OCRData, error)
ExtractFromFile(filePath string) (*OCRData, error)
ExtractWithLanguage(filePath string, language string) (*OCRData, error)
}
OCRExtractor interface for OCR functionality
func GetOCRExtractor ¶
func GetOCRExtractor() OCRExtractor
GetOCRExtractor returns an OCR extractor instance This will return a NoOpOCRExtractor if Tesseract is not available
func NewTesseractExtractor ¶
func NewTesseractExtractor() (OCRExtractor, error)
NewTesseractExtractor creates a new Tesseract OCR extractor Returns an error if Tesseract is not available