-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#196: 회원가입에 이미지 업로드 추가해요 #200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
야무져요 ? 왤케 빨리 찍어 야빠리 스고이다네 브라우니쨩
@Serializable | ||
data class ImageDto( | ||
val url: String, | ||
val imageUrl: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImageDto가 너무 통용적인 이름이지 않을까요?
PresignedUrlDto, ProfileImageUrlDto ... 생각하시기에 더 나은 네이밍이 있을까용 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImageUrlDto로 갑니다 둘다 너무 도메인 specific함
path("api/v1/image/presigned-url") | ||
parameter("imageExtension", mimeType) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mimeType에 이미지 타입 jpg, png 같은걸 보내는 걸로 알고있는데요 !
imageExtension은 어떤 의미가 있어요 ? (진짜 궁금)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
서버로 보내는건데요 파일 링크 미리 생성하는데 필요한가봄 .jpg .webp 이런식으로
data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/ImageDecoderDataSourceImpl.kt
Show resolved
Hide resolved
sendWithoutRequest { | ||
!it.url.host.endsWith("s3.ap-northeast-2.amazonaws.com") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 코드의 동작이 뭔가요 ??
GPT가 아래라고 설명하긴 했는데요, I 궁금
이와 같은 조건은 AWS S3와 같은 특정 호스트로만 요청을 허용하고 나머지 요청은 무시하거나 제한하는 데 사용될 수 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S3를 호출할때 token 들어가면 안되서용
override suspend fun decodeImage(imagePath: String): String { | ||
val uri = Uri.parse(imagePath) | ||
|
||
return resizeAndConvertToWebp(context, uri) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사진 로드 압축, 타입 변환 꽤 무거운 작업으로 보이는데요
Default Dispather를 사용하는건 어떨까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ioDispatcher로 바꿨어용
|
||
FileOutputStream(outputFile).use { outputStream -> | ||
if (!resizedBitmap.compress(Bitmap.CompressFormat.WEBP, 80, outputStream)) { | ||
throw ImageUploadFailedException.ImageDecodeFailedException( | ||
"Failed to compress bitmap to WebP format." | ||
) | ||
} | ||
outputStream.flush() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
비트맵 리소스 함수 중 메모리 환원하는 recycle()이 있는데요,
FileOutputStream 밑에 resizedBitmap.recycle() 호출하는 건 어떨까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
바로 하냐 나중에 자동으로 하냐 차이라서 없어도 무방한데요
1. 📄 관련된 이슈 및 소개
close #196
2. 🔥 변경된 점
회원가입시 이미지 업로드 기능을 추가해요
3. ✅ 필수 체크 사항
4. 📸 작업물 사진 공유(선택)
5. 💡알게된 혹은 궁금한 사항