From ab4813d3aae88221bdb18827c85b9e23bee68c4f Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Fri, 3 Oct 2025 17:30:22 +0800 Subject: [PATCH] upd: upload image Deskripsi: - upload image edit crop NO Issues --- app/(application)/edit-profile.tsx | 8 ++++---- app/(application)/member/create.tsx | 8 ++++---- app/(application)/member/edit/[id].tsx | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/(application)/edit-profile.tsx b/app/(application)/edit-profile.tsx index 8a711d2..78bf24b 100644 --- a/app/(application)/edit-profile.tsx +++ b/app/(application)/edit-profile.tsx @@ -165,8 +165,8 @@ export default function EditProfile() { if (imgForm != undefined) { fd.append("file", { uri: imgForm.uri, - type: imgForm.mimeType, - name: imgForm.fileName, + type: imgForm.mimeType || "image/jpeg", + name: imgForm.fileName || "image.jpg", } as any); } else { fd.append("file", "undefined",); @@ -199,8 +199,8 @@ export default function EditProfile() { let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ["images"], allowsEditing: true, - quality: 1, - aspect: [1, 1], + quality: 0.9, + aspect: [1, 1] }); if (!result.canceled) { diff --git a/app/(application)/member/create.tsx b/app/(application)/member/create.tsx index d533764..5737dd4 100644 --- a/app/(application)/member/create.tsx +++ b/app/(application)/member/create.tsx @@ -167,8 +167,8 @@ export default function CreateMember() { if (imgForm != undefined) { fd.append("file", { uri: imgForm.uri, - type: imgForm.mimeType, - name: imgForm.fileName, + type: imgForm.mimeType || "image/jpeg", + name: imgForm.fileName || "image.jpg", } as any) } else { fd.append("file", "undefined") @@ -195,8 +195,8 @@ export default function CreateMember() { let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ["images"], allowsEditing: true, - quality: 1, - aspect: [1, 1], + quality: 0.9, + aspect: [1, 1] }); if (!result.canceled) { diff --git a/app/(application)/member/edit/[id].tsx b/app/(application)/member/edit/[id].tsx index 18f40c5..7e4d1f5 100644 --- a/app/(application)/member/edit/[id].tsx +++ b/app/(application)/member/edit/[id].tsx @@ -188,8 +188,8 @@ export default function EditMember() { if (imgForm != undefined) { fd.append("file", { uri: imgForm.uri, - type: imgForm.mimeType, - name: imgForm.fileName, + type: imgForm.mimeType || "image/jpeg", + name: imgForm.fileName || "image.jpg", } as any); } else { fd.append("file", "undefined",); @@ -222,8 +222,8 @@ export default function EditMember() { let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ["images"], allowsEditing: true, - quality: 1, - aspect: [1, 1], + quality: 0.9, + aspect: [1, 1] }); if (!result.canceled) {