Skip to content

Commit b270454

Browse files
authored
[#673] 이미지 리사이징 기능 임시적으로 주석 처리 (#674)
- fix: 이미지 리사이징 기능 임시적으로 주석 처리
1 parent 58200d7 commit b270454

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/app/api/imageOptimize/route.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ export async function GET(request: NextRequest) {
88
const { searchParams } = new URL(request.url);
99

1010
const src = searchParams.get('src');
11-
const width = searchParams.get('width');
12-
const height = searchParams.get('height');
11+
// const width = searchParams.get('width');
12+
// const height = searchParams.get('height');
1313

1414
if (!src || typeof src !== 'string') {
1515
return new NextResponse('Missing or invalid "src" query parameter', {
1616
status: 400,
1717
});
1818
}
1919

20-
const widthInt = width ? parseInt(width as string, 10) : null;
21-
const heightInt = height ? parseInt(height as string, 10) : null;
20+
// const widthInt = width ? parseInt(width as string, 10) : null;
21+
// const heightInt = height ? parseInt(height as string, 10) : null;
2222
const isGif = src.endsWith('.gif');
2323

2424
const getImageBuffer = async () => {
@@ -50,10 +50,10 @@ export async function GET(request: NextRequest) {
5050
? sharp(imageBuffer, { animated: true }).gif()
5151
: sharp(imageBuffer).webp();
5252

53-
// 이미지 리사이징
54-
if (widthInt || heightInt) {
55-
image.resize(widthInt, heightInt);
56-
}
53+
// // 이미지 리사이징
54+
// if (widthInt || heightInt) {
55+
// image.resize(widthInt, heightInt);
56+
// }
5757

5858
const optimizedImageBuffer = await image.toBuffer();
5959

src/components/common/Image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const Image = ({
2121
}: ImageProps) => {
2222
const params = new URLSearchParams({ src });
2323

24-
if (width) params.append('width', width.toString());
25-
if (height) params.append('height', height.toString());
24+
// if (width) params.append('width', width.toString());
25+
// if (height) params.append('height', height.toString());
2626

2727
const optimizedSrc = `/api/imageOptimize?${params.toString()}`;
2828

0 commit comments

Comments
 (0)