Skip to content

Commit

Permalink
Merge pull request #147 from 4Ailen/feat/#144_Image-compress
Browse files Browse the repository at this point in the history
Feat/#144 image compress
  • Loading branch information
KIM-JUHYEON-79 authored Sep 10, 2023
2 parents 2cc640b + a34ceb0 commit 3d27526
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/apis/apis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ class APIs {
}
// FormData 파일 필드 추가
if (member.profileImage != null && member.profileImage!.isNotEmpty) {
var file = await http.MultipartFile.fromPath(
'profileImage',
member.profileImage!
var file = await ImageUtil.compressImageToMultipartFile(
'profileImage',
member.profileImage!,
);
request.files.add(file);
}
Expand Down Expand Up @@ -1639,8 +1639,10 @@ class APIs {
marketArticle.imageUrls!.isNotEmpty) {
for (String imagePath in marketArticle.imageUrls!) {
if (imagePath.isNotEmpty) {
var file = await http.MultipartFile.fromPath(
'imageUrls', imagePath);
var file = await ImageUtil.compressImageToMultipartFile(
'imageUrls',
imagePath,
);
request.files.add(file);
}
}
Expand Down Expand Up @@ -2216,7 +2218,10 @@ class APIs {
if (board.imageUrls != null && board.imageUrls!.isNotEmpty) {
for (String imagePath in board.imageUrls!) {
if (imagePath.isNotEmpty) {
var file = await http.MultipartFile.fromPath('imageUrls', imagePath);
var file = await ImageUtil.compressImageToMultipartFile(
'imageUrls',
imagePath,
);
request.files.add(file);
}
}
Expand Down

0 comments on commit 3d27526

Please sign in to comment.