Skip to content

Commit beeb084

Browse files
committed
Use numerics
1 parent 3e5c5b2 commit beeb084

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

image-api/src/main/scala/no/ndla/imageapi/controller/RawController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class RawController(using
180180
}
181181
imageStorage
182182
.uploadFromStream(
183-
s"${image.fileShortName}_width=${imageParams.width}_height=${imageParams.height}.${image.format}",
183+
s"${image.fileShortName}_width=${imageParams.width.getOrElse(0)}_height=${imageParams.height.getOrElse(0)}.${image.format}",
184184
resized.get.stream,
185185
resized.get.contentType,
186186
resized.get.contentLength

image-api/src/main/scala/no/ndla/imageapi/service/ImageStorageService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ImageStorageService(using
6464
def get(imageKey: String, imageParams: ImageParams): Try[(ImageStream, Boolean)] = {
6565
val lastPeriod = imageKey.lastIndexOf(".")
6666
val (pre, post) = imageKey.splitAt(lastPeriod)
67-
val maybeFileName = s"${pre}_width=${imageParams.width}_height=${imageParams.height}${post}"
67+
val maybeFileName = s"${pre}_width=${imageParams.width.getOrElse(0)}_height=${imageParams.height.getOrElse(0)}${post}"
6868
if (head(maybeFileName)) {
6969
getObject(maybeFileName, true)
7070
} else {

0 commit comments

Comments
 (0)