feat: image variants engine

This commit is contained in:
fsylvain committed 2026-10-08 02:33:32 +02:00
1 parent f0845de643
commit f1d56ef50e
80 files changed
+7312 -84

No files matched your search

@@ -0,0 +1,14 @@
package models
import "time"
type ImageVariantFile struct {
ID uint32 `gorm:"primaryKey;autoIncrement"`
VariantName string `gorm:"not null;size:32;uniqueIndex:idx_image_variant_files_pair,priority:1"`
SourceName string `gorm:"not null;size:191;uniqueIndex:idx_image_variant_files_pair,priority:2;index:idx_image_variant_files_source"`
CachedName string `gorm:"not null;size:191"`
ContentType string `gorm:"not null;size:64"`
Size int64 `gorm:"not null"`
Fingerprint string `gorm:"not null;size:64"`
CreatedAt time.Time
}
@@ -0,0 +1,16 @@
package models
import "time"
type ImageVariant struct {
Name string `gorm:"primaryKey;size:32"`
Width *int
Height *int
Fit string `gorm:"not null;size:16"`
Format string `gorm:"not null;size:16"`
Quality *int
GenerateOnUpload bool `gorm:"not null"`
Enabled bool `gorm:"not null"`
CreatedAt time.Time
UpdatedAt time.Time
}