mirror of
https://github.com/imgproxy/imgproxy.git
synced 2026-04-23 19:41:06 +02:00
ba73b16c39
* lazy processing test * Processor instance * Fixes to prepare.go
24 lines
603 B
Go
24 lines
603 B
Go
package processing
|
|
|
|
import (
|
|
"github.com/imgproxy/imgproxy/v3/auximageprovider"
|
|
)
|
|
|
|
// Processor is responsible for processing images according to the given configuration.
|
|
type Processor struct {
|
|
config *Config
|
|
watermarkProvider auximageprovider.Provider
|
|
}
|
|
|
|
// New creates a new Processor instance with the given configuration and watermark provider
|
|
func New(config *Config, watermark auximageprovider.Provider) (*Processor, error) {
|
|
if err := config.Validate(); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Processor{
|
|
config: config,
|
|
watermarkProvider: watermark,
|
|
}, nil
|
|
}
|