From 3e52fef4bc9b9e54950c8b72eda0f1793d21fdde Mon Sep 17 00:00:00 2001 From: ry0218 Date: Sat, 16 Aug 2025 19:56:20 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20cdn=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MenuForm.tsx | 10 +++------- src/components/MenuPhotoSection.tsx | 2 +- src/components/PhotoUpload.tsx | 10 +++------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/components/MenuForm.tsx b/src/components/MenuForm.tsx index 83dd2cf..0d9adbe 100644 --- a/src/components/MenuForm.tsx +++ b/src/components/MenuForm.tsx @@ -105,9 +105,7 @@ const MenuForm: React.FC = ({ fetch(initialImageUrl) .then((response) => response.blob()) .then((blob) => { - const file = new File([blob], "home-camera-photo.jpg", { - type: "image/jpeg", - }); + const file = new File([blob], initialImageUrl); handleFileSelect(file); }) .catch((error) => { @@ -159,7 +157,7 @@ const MenuForm: React.FC = ({ console.log("새로 찍은 사진:", result.tempFileURL); const fullImageUrl = originalPhoto ? `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}?s=${originalPhoto.imageWidth}x${originalPhoto.imageHeight}&t=crop&q=70` - : `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}?q=70`; + : `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}`; // 현재 표시할 이미지 URL 업데이트 setCurrentImageUrl(fullImageUrl); @@ -168,9 +166,7 @@ const MenuForm: React.FC = ({ fetch(fullImageUrl) .then((response) => response.blob()) .then((blob) => { - const file = new File([blob], "new-camera-photo.jpg", { - type: "image/jpeg", - }); + const file = new File([blob], result.tempFileURL as string); handleFileSelect(file); }) .catch((error) => { diff --git a/src/components/MenuPhotoSection.tsx b/src/components/MenuPhotoSection.tsx index 9f61a1d..d91b09c 100644 --- a/src/components/MenuPhotoSection.tsx +++ b/src/components/MenuPhotoSection.tsx @@ -52,7 +52,7 @@ const MenuPhotoSection: React.FC = ({ if (originalPhoto) { return `${process.env.NEXT_PUBLIC_IMAGE_URL}/${imageUrl}?s=${originalPhoto.imageWidth}x${originalPhoto.imageHeight}&t=crop&q=70`; } - return `${process.env.NEXT_PUBLIC_IMAGE_URL}/${imageUrl}?q=70`; + return `${process.env.NEXT_PUBLIC_IMAGE_URL}/${imageUrl}`; }; if (mode === "create") { // 1. 사진 없이 생성하는 경우 & 2. 네이티브에서 사진촬영 후 생성하는 경우 diff --git a/src/components/PhotoUpload.tsx b/src/components/PhotoUpload.tsx index 2038822..380d4ce 100644 --- a/src/components/PhotoUpload.tsx +++ b/src/components/PhotoUpload.tsx @@ -243,7 +243,7 @@ const PhotoUpload: React.FC = ({ // 원본 사진 정보가 있으면 해당 크기로, 없으면 기본 크기로 URL 생성 const fullImageUrl = cdnPhoto ? `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}?s=${cdnPhoto.imageWidth}x${cdnPhoto.imageHeight}&t=crop&q=70` - : `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}?q=70`; + : `${process.env.NEXT_PUBLIC_IMAGE_URL}/${result.tempFileURL}`; console.log("완전한 이미지 URL:", fullImageUrl); if (previewOnly) { @@ -254,9 +254,7 @@ const PhotoUpload: React.FC = ({ fetch(fullImageUrl) .then((response) => response.blob()) .then((blob) => { - const file = new File([blob], "camera-photo.jpg", { - type: "image/jpeg", - }); + const file = new File([blob], result.tempFileURL as string); onFileSelect?.(file); }) .catch((error) => { @@ -268,9 +266,7 @@ const PhotoUpload: React.FC = ({ fetch(fullImageUrl) .then((response) => response.blob()) .then((blob) => { - const file = new File([blob], "camera-photo.jpg", { - type: "image/jpeg", - }); + const file = new File([blob], result.tempFileURL as string); handleFileSelect(file); }) .catch((error) => {