Skip to content

Commit

Permalink
fix: add Arabic font support and SVG upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BasselArt committed Dec 31, 2024
1 parent 951b64a commit f04f073
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/handlers/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") != "" {
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion app/pkg/validate/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f04f073

Please sign in to comment.