1.1 KiB
1.1 KiB
Go Image Manipulation API - Project Rules (libvips/bimg Version)
1. Tech Stack
- Language: Go 1.26.1
- Web Framework: Fiber v3 (github.com/gofiber/fiber/v3)
- Image Engine: libvips via bimg (github.com/h2non/bimg)
- Database: GORM (MySQL) & Redis (Auth/Token storage)
2. Image Processing Logic
- Use
bimgfor all transformations. - Supported Input/Output: AVIF, WEBP, PNG, JPG.
- Quality: Map 1-100 values to
bimg.Options.Quality. - Transformation Types:
Cover: Usebimg.Options.Enlarge = trueandbimg.Options.Crop = true.Crop: Usebimg.Options.Type = bimg.ImageType(Target format).Resize: Usebimg.Options.Widthandbimg.Options.Height.
3. Performance & Safety
- CRITICAL:
libvipsC kaynaklarını kullanır. Bellek sızıntılarını önlemek içinbimg.VipsFree()veya garbage collection dostu yapıları takip et. - Async Processing: Büyük işlemler için Fiber'in
ctx.Next()yapısını bozmadanpoolmantığını değerlendir. - Redis Security: Her manipülasyon isteği
?token=parametresiyle gelmeli ve Redis'tekiimage_idile eşleşmeli.