Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/components/MenuForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ const MenuForm: React.FC<MenuFormProps> = ({
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) => {
Expand Down Expand Up @@ -159,7 +157,7 @@ const MenuForm: React.FC<MenuFormProps> = ({
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);
Expand All @@ -168,9 +166,7 @@ const MenuForm: React.FC<MenuFormProps> = ({
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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MenuPhotoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const MenuPhotoSection: React.FC<MenuPhotoSectionProps> = ({
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. 네이티브에서 사진촬영 후 생성하는 경우
Expand Down
10 changes: 3 additions & 7 deletions src/components/PhotoUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const PhotoUpload: React.FC<PhotoUploadProps> = ({
// 원본 사진 정보가 있으면 해당 크기로, 없으면 기본 크기로 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) {
Expand All @@ -254,9 +254,7 @@ const PhotoUpload: React.FC<PhotoUploadProps> = ({
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) => {
Expand All @@ -268,9 +266,7 @@ const PhotoUpload: React.FC<PhotoUploadProps> = ({
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) => {
Expand Down