From 415134c5b6a9d8718efd8a765ee679c8cfa8e101 Mon Sep 17 00:00:00 2001 From: steven choi Date: Tue, 14 Nov 2023 12:00:50 +1100 Subject: [PATCH] #785_2 fix --- .../au/org/ala/profile/api/ApiController.groovy | 2 ++ .../au/org/ala/profile/hub/ProfileController.groovy | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy index a7361628..d958a192 100644 --- a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy +++ b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy @@ -620,6 +620,7 @@ class ApiController extends BaseController { ) def getLocalImage() { + params.imageId = params.fileName forward controller: "profile", action: "getLocalImage" } @@ -694,6 +695,7 @@ class ApiController extends BaseController { ) def retrieveLocalThumbnailImage () { + params.imageId = params.fileName forward controller: "profile", action: "retrieveLocalThumbnailImage" } diff --git a/grails-app/controllers/au/org/ala/profile/hub/ProfileController.groovy b/grails-app/controllers/au/org/ala/profile/hub/ProfileController.groovy index 60708900..0168c43f 100644 --- a/grails-app/controllers/au/org/ala/profile/hub/ProfileController.groovy +++ b/grails-app/controllers/au/org/ala/profile/hub/ProfileController.groovy @@ -409,9 +409,9 @@ class ProfileController extends BaseController { ImageType type = params.type as ImageType //NB this imageId param already has the file extension on it, really the file name on disk if (type == ImageType.STAGED) { - displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.fileName, true) + displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.imageId, true) } else if (type == ImageType.PRIVATE) { - displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.fileName, true) + displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.imageId, true) } } catch (IllegalArgumentException e) { log.warn(e) @@ -428,9 +428,9 @@ class ProfileController extends BaseController { ImageType type = params.type as ImageType //NB this imageId param already has the file extension on it, really the file name on disk if (type == ImageType.STAGED) { - displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.fileName, false) + displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.imageId, false) } else if (type == ImageType.PRIVATE) { - displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.fileName, false) + displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.imageId, false) } } catch (IllegalArgumentException e) { log.warn(e)