From f04f07366884438e2c320cf74f6a6220a223c93e Mon Sep 17 00:00:00 2001 From: Bassel Al Sheikh Ali Date: Tue, 31 Dec 2024 09:22:06 +0300 Subject: [PATCH] fix: add Arabic font support and SVG upload --- Dockerfile | 1 + app/handlers/images.go | 4 ++-- app/pkg/validate/upload.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6c42dd9e..7ce93c14b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ COPY go.mod go.sum ./ RUN go mod download COPY . ./ +RUN go mod tidy ARG COMMITHASH RUN COMMITHASH=${COMMITHASH} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build-server diff --git a/app/handlers/images.go b/app/handlers/images.go index 8611c0b11..c7d9af4b1 100644 --- a/app/handlers/images.go +++ b/app/handlers/images.go @@ -201,7 +201,7 @@ func Favicon() web.HandlerFunc { opts := []imagic.ImageOperation{} if size > 0 { - opts = append(opts, imagic.FitToWidth(size)) + opts = append(opts, imagic.Resize(size)) } if c.QueryParam("bg") != "" { @@ -238,7 +238,7 @@ func ViewUploadedImage() web.HandlerFunc { bytes := q.Result.Content if size > 0 { - bytes, err = imagic.Apply(bytes, imagic.FitToWidth(size)) + bytes, err = imagic.Apply(bytes, imagic.Resize(size)) if err != nil { return c.Failure(err) } diff --git a/app/pkg/validate/upload.go b/app/pkg/validate/upload.go index 9fc81452c..8f392d73d 100644 --- a/app/pkg/validate/upload.go +++ b/app/pkg/validate/upload.go @@ -110,7 +110,7 @@ func ImageUpload(ctx context.Context, upload *dto.ImageUpload, opts ImageUploadO } if logo.Height > MaxDimensionSize && logo.Width > MaxDimensionSize { - newImageBytes, err := imagic.Apply(upload.Upload.Content, imagic.FitToWidth(MaxDimensionSize)) + newImageBytes, err := imagic.Apply(upload.Upload.Content, imagic.Resize(MaxDimensionSize)) if err != nil { return nil, err }