feat(photos): добавить эффекты и настройки панели редактора

- текстура, чёткость, дымка, виньетка и зерно в неразрушающем редакторе
- живой WebGL2-предпросмотр эффектов и CPU-фолбэк
- секции редактора свёрнуты по умолчанию, состояние в localStorage
- вкладка «Редактирование» доступна только из просмотрщика
This commit is contained in:
iu
2026-10-24 22:57:30 +03:00
parent 4cc5c0f340
commit c953008a86
18 changed files with 3548 additions and 173 deletions
+4 -3
View File
@@ -123,14 +123,15 @@ func (h *Handler) Download(c *gin.Context) {
// the photo metadata and the edited version is rendered in the background.
func (h *Handler) Edit(c *gin.Context) {
var req struct {
Light LightParams `json:"light"`
Color ColorParams `json:"color"`
Light LightParams `json:"light"`
Color ColorParams `json:"color"`
Effects EffectsParams `json:"effects"`
}
if err := c.ShouldBindJSON(&req); err != nil {
httpx.RespondError(c, httpx.BadRequest("invalid_request", "edit params are required"))
return
}
p, err := h.svc.EditPhoto(c.Request.Context(), c.Param("id"), auth.UserID(c), EditParams{Light: req.Light, Color: req.Color})
p, err := h.svc.EditPhoto(c.Request.Context(), c.Param("id"), auth.UserID(c), EditParams{Light: req.Light, Color: req.Color, Effects: req.Effects})
if err != nil {
httpx.RespondError(c, err)
return