Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into dev_ysCha
This commit is contained in:
commit
97b3a8c2ba
@ -95,16 +95,11 @@ const resizeImage = async (image) => {
|
||||
const scaleY = targetImageHeight / image.bitmap.height
|
||||
let scale = Math.min(scaleX, scaleY) // 비율 유지하면서 최대한 크게
|
||||
|
||||
// scale 저장 (나중에 전체 확대에 사용)
|
||||
const originalScale = scale
|
||||
|
||||
let finalWidth = Math.round(image.bitmap.width * scale)
|
||||
let finalHeight = Math.round(image.bitmap.height * scale)
|
||||
|
||||
if (scale >= 0.6) {
|
||||
// 실제 리사이즈 실행
|
||||
image.resize({ w: finalWidth, h: finalHeight })
|
||||
}
|
||||
// 항상 리사이즈 실행 (scale >= 0.6 조건 제거)
|
||||
image.resize({ w: finalWidth, h: finalHeight })
|
||||
|
||||
//배경 이미지를 생성
|
||||
const mixedImage = new Jimp({ width: convertStandardWidth, height: convertStandardHeight, color: 0xffffffff })
|
||||
@ -119,14 +114,7 @@ const resizeImage = async (image) => {
|
||||
opacityDest: 1,
|
||||
})
|
||||
|
||||
// scale이 0.8 이하인 경우 완성된 이미지를 전체적으로 확대
|
||||
if (originalScale <= 0.8) {
|
||||
const enlargeRatio = 1.5 // 50% 확대
|
||||
const newWidth = Math.round(mixedImage.bitmap.width * enlargeRatio)
|
||||
const newHeight = Math.round(mixedImage.bitmap.height * enlargeRatio)
|
||||
|
||||
mixedImage.resize({ w: newWidth, h: newHeight })
|
||||
}
|
||||
// 1.5x 확대 로직 제거 - 이미지가 템플릿 크기를 초과하지 않도록 함
|
||||
|
||||
return mixedImage
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user