Skip to content

Commit

Permalink
fix: extension 중복, 경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeryboy committed Aug 30, 2023
1 parent cdc5cb1 commit ec655cd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class ImageServiceImpl(

val filename = "${timeMillis}_${requestImage.originalFilename}"
val totalFilename = path + filename
val saveFile = Paths.get("$totalFilename.$extension")
val saveFile = Paths.get(totalFilename)
requestImage.transferTo(saveFile)

val totalThumbnailFilename = "${path}thumbnail_$filename"
val thumbnailFile = Paths.get("$totalThumbnailFilename.$extension")
val thumbnailFile = Paths.get(totalThumbnailFilename)
Thumbnailator.createThumbnail(saveFile.toFile(), thumbnailFile.toFile(), 100, 100);

val image = MainImageEntity(
Expand Down Expand Up @@ -91,7 +91,7 @@ class ImageServiceImpl(
@Transactional
override fun createImageURL(image: MainImageEntity?): String? {
return if (image != null) {
"${endpointProperties.backend}/image/${image.filename}"
"${endpointProperties.backend}/file/${image.filename}"
} else null
}

Expand Down

0 comments on commit ec655cd

Please sign in to comment.