Skip to content

Commit 937ca2f

Browse files
authored
On demand image thumbnails and tiles (#214)
* On demand thumbnails and tiles - Split file operation code from GORM StorageLocation entities into separate StorageOperations classes - Replace filesize, redirect location, inputstream, mimetype, extension closures in ImageController with ImageInfo class to consolidate calls to S3, etc - Limit /image/$id/$type mappings to just known thumbnail types, fixes metadata fragments returning 404s - Make all AuditMessages save async - Add caching of ImageInfo objects for thumbnails and tiles - Add generating ImageThumbnail db entries when creating thumbnails - Add saving Image's maximum zoom level when creating tiles - Update commons-lang usage to commons-lang3 - Update gradle dependencies for postgres, zip4j, guava, caffeeine, google api client - Add Grails GORM Async entity support - Remove all use of LogService and replace with SLF4j * Update tests - Remove unused ImageStoreService methods - Restore analyticsSerivce functionality - Fix ImageControllerSpec unit tests for new ImageController internals
1 parent 927a0a6 commit 937ca2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1930
-8060
lines changed

build.gradle

+12-8
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ configurations.all {
8686

8787
dependencies {
8888

89+
// implementation 'org.grails.plugins:async:5.0.2'
8990
implementation group: 'org.grails', name: 'grails-async-gpars'
91+
implementation group: 'org.grails', name: 'grails-datastore-gorm-async'
9092

9193
implementation group: 'org.grails.plugins', name: 'grails-pretty-time', version: '4.0.0'
9294
implementation 'org.grails.plugins:csv:1.0.1'
@@ -105,7 +107,7 @@ dependencies {
105107
implementation group: 'au.org.ala.plugins.grails', name:'images-client-plugin', version: '1.1', changing: true
106108

107109
// Added dependencies
108-
runtimeOnly 'com.zaxxer:HikariCP:5.0.1'
110+
runtimeOnly 'com.zaxxer:HikariCP:5.1.0'
109111
implementation 'org.grails.plugins:postgresql-extensions:7.0.0'
110112
implementation "org.flywaydb:flyway-core:9.4.0"
111113
implementation 'org.grails.plugins:cache-headers:2.0.2'
@@ -119,7 +121,7 @@ dependencies {
119121
implementation group: 'org.locationtech.jts', name: 'jts-core', version: '1.15.0'
120122
implementation "com.amazonaws:aws-java-sdk-s3:$amazonAwsSdkVersion"
121123
implementation 'org.javaswift:joss:0.10.4'
122-
runtimeOnly 'org.postgresql:postgresql:42.5.4'
124+
runtimeOnly 'org.postgresql:postgresql:42.7.4'
123125

124126
implementation 'org.elasticsearch:elasticsearch:7.17.1'
125127
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.17.1'
@@ -132,18 +134,20 @@ dependencies {
132134
implementation 'org.apache.commons:commons-imaging:1.0-SNAPSHOT'
133135
implementation 'org.apache.tika:tika-core:2.5.0'
134136
implementation 'com.github.jai-imageio:jai-imageio-core:1.4.0'
135-
implementation 'au.org.ala:image-utils:1.9.0'
137+
implementation 'au.org.ala:image-utils:1.10.0-SNAPSHOT'
136138

137-
implementation 'net.lingala.zip4j:zip4j:2.10.0'
138-
implementation 'com.google.guava:guava:31.1-jre'
139-
implementation 'org.apache.avro:avro:1.11.0'
140-
implementation 'org.xerial.snappy:snappy-java:1.1.8.4'
139+
implementation 'net.lingala.zip4j:zip4j:2.11.3'
140+
implementation 'com.google.guava:guava:33.2.1-jre'
141+
implementation 'com.github.ben-manes.caffeine:caffeine:2.9.3'
142+
143+
implementation 'org.apache.avro:avro:1.11.4'
144+
implementation 'org.xerial.snappy:snappy-java:1.1.10.4'
141145

142146
// Swagger
143147
implementation 'au.org.ala.plugins:openapi:1.1.0'
144148

145149
// Google analytics requirement
146-
implementation 'com.google.api-client:google-api-client:1.33.2'
150+
implementation 'com.google.api-client:google-api-client:1.33.4'
147151
implementation 'com.google.apis:google-api-services-analytics:v3-rev20190807-1.32.1'
148152

149153
// Standard grails

grails-app/controllers/au/org/ala/images/AdminController.groovy

+14-2
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,24 @@ class AdminController {
550550
def clearCollectoryCache(){
551551
collectoryService.clearCache()
552552
flash.message = 'Collectory cache cleared'
553-
redirect(action:'tools', message: 'Cache is cleared')
553+
redirect(action:'tools', message: 'Collectory Cache is cleared')
554554
}
555555

556556
def clearHibernateCache() {
557557
sessionFactory.cache?.evictAllRegions()
558558
flash.message = 'Hibernate cache cleared'
559-
redirect(action:'tools', message: 'Cache is cleared')
559+
redirect(action:'tools', message: 'Hibernate Cache is cleared')
560+
}
561+
562+
def clearThumbnailLookupCache() {
563+
imageStoreService.clearThumbnailLookupCache()
564+
flash.message = 'Thumbnail lookup cache cleared'
565+
redirect(action:'tools', message: 'Thumbnail Lookup Cache is cleared')
566+
}
567+
568+
def clearTileLookupCache() {
569+
imageStoreService.clearTileLookupCache()
570+
flash.message = 'Tile lookup cache cleared'
571+
redirect(action:'tools', message: 'Tile Lookup Cache is cleared')
560572
}
561573
}

0 commit comments

Comments
 (0)