processor.go 603 B

1234567891011121314151617181920212223
  1. package processing
  2. import (
  3. "github.com/imgproxy/imgproxy/v3/auximageprovider"
  4. )
  5. // Processor is responsible for processing images according to the given configuration.
  6. type Processor struct {
  7. config *Config
  8. watermarkProvider auximageprovider.Provider
  9. }
  10. // New creates a new Processor instance with the given configuration and watermark provider
  11. func New(config *Config, watermark auximageprovider.Provider) (*Processor, error) {
  12. if err := config.Validate(); err != nil {
  13. return nil, err
  14. }
  15. return &Processor{
  16. config: config,
  17. watermarkProvider: watermark,
  18. }, nil
  19. }