Skip to content

Commit

Permalink
{improvement} - 이미지 원본 사이즈 유지하고 변형하기 \n
Browse files Browse the repository at this point in the history
  • Loading branch information
JokerTrickster committed Oct 7, 2024
1 parent 9b866e5 commit a7f91c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/aws/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var imgMeta = map[ImgType]imgMetaStruct{
bucket: func() string { return "dev-food-recommendation" },
domain: func() string { return "dev-food-recommendation.s3.ap-northeast-2.amazonaws.com" },
path: "images",
width: 512,//512 x 341
width: 512, //512 x 341
height: 341,
expireTime: 2 * time.Hour,
},
Expand Down Expand Up @@ -58,7 +58,8 @@ func ImageUpload(ctx context.Context, file *multipart.FileHeader, filename strin
img = imaging.Resize(img, meta.width, meta.height, imaging.Lanczos)
}
} else {
img = imaging.Fill(img, meta.width, meta.height, imaging.Center, imaging.Lanczos)
img = imaging.Fit(img, meta.width, meta.height, imaging.Lanczos)
//img = imaging.Fill(img, meta.width, meta.height, imaging.Center, imaging.Lanczos)
}

buf := new(bytes.Buffer)
Expand Down

0 comments on commit a7f91c2

Please sign in to comment.