Skip to content

Commit

Permalink
[BE] feat: ImageFileUploadService jpeg 확장자 지원 추가 (#946) (#947)
Browse files Browse the repository at this point in the history
* feat: ImageFileUploadService jpeg, webp 확장자 지원 추가

* fix: webp 확장자 지원 삭제

- iOS에서 webp 지원 불가 이슈
  • Loading branch information
seokjin8678 authored May 15, 2024
1 parent 133b107 commit 20860b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class ImageFileUploadService {

private static final int MAX_FILE_SIZE = 2_000_000; // 2MB
private static final Set<FileExtension> ALLOW_IMAGE_EXTENSION = EnumSet.of(FileExtension.JPG, FileExtension.PNG);
private static final Set<FileExtension> ALLOW_IMAGE_EXTENSION = EnumSet.of(FileExtension.JPG, FileExtension.JPEG, FileExtension.PNG);

private final StorageClient storageClient;
private final UploadFileRepository uploadFileRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@RequiredArgsConstructor
public enum FileExtension {
JPG(".jpg", MimeTypeUtils.IMAGE_JPEG),
JPEG(".jpeg", MimeTypeUtils.IMAGE_JPEG),
PNG(".png", MimeTypeUtils.IMAGE_PNG),
NONE("", MimeTypeUtils.APPLICATION_OCTET_STREAM),
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void setUp() {
}

@ParameterizedTest
@ValueSource(strings = {"image.png", "image.jpg"})
@ValueSource(strings = {"image.png", "image.jpg", "image.jpeg"})
void 이미지를_업로드할때_JPG_PNG_확장자이면_성공한다(String filename) {
// given
MultipartFile multipartFile = new MockMultipartFile("image", filename, "image/png",
Expand Down

0 comments on commit 20860b3

Please sign in to comment.