Documentation
¶
Index ¶
- type ProcessResult
- type Processor
- func (p *Processor) CreateAllVariants(sourcePath, uuid, filename string) ([]*VariantResult, error)
- func (p *Processor) CreateVariant(sourcePath, uuid, filename string, config model.ImageVariantConfig, ...) (*VariantResult, error)
- func (p *Processor) DeleteMediaFiles(uuid string) error
- func (p *Processor) DetectMimeType(data []byte) string
- func (p *Processor) GetImageDimensions(path string) (width, height int, err error)
- func (p *Processor) IsImage(mimeType string) bool
- func (p *Processor) IsSupportedType(mimeType string) bool
- func (p *Processor) ProcessImage(reader io.Reader, uuid, filename string) (*ProcessResult, error)
- type VariantResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProcessResult ¶
ProcessResult contains the result of processing an uploaded image.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor handles image processing operations using pure Go libraries.
func NewProcessor ¶
NewProcessor creates a new image processor.
func (*Processor) CreateAllVariants ¶
func (p *Processor) CreateAllVariants(sourcePath, uuid, filename string) ([]*VariantResult, error)
CreateAllVariants creates all standard variants for an image.
func (*Processor) CreateVariant ¶
func (p *Processor) CreateVariant(sourcePath, uuid, filename string, config model.ImageVariantConfig, variantType string) (*VariantResult, error)
CreateVariant creates a resized variant of an image.
func (*Processor) DeleteMediaFiles ¶
DeleteMediaFiles removes all files associated with a media item.
func (*Processor) DetectMimeType ¶
DetectMimeType detects the MIME type of image data.
func (*Processor) GetImageDimensions ¶
GetImageDimensions returns the dimensions of an image file.
func (*Processor) IsImage ¶
IsImage checks if a MIME type represents an image that can be processed.
func (*Processor) IsSupportedType ¶
IsSupportedType checks if a MIME type is supported for upload.
func (*Processor) ProcessImage ¶
ProcessImage reads an uploaded image file and returns its metadata. It saves the original file and returns processing results.