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) => {