It's not always a number. There may be "b" and "rc" characters there and doing a substring on internalVersion is ugly as it assumes two characters before a dot.
OK, I use now your proposal.
But I have another problem, with code you proposed I think:
I have in index.htt at line number 359 this code:
<ja:if test="<%= jAlbumVersion > 23 %>">
<%
usingFallback() {
import net.jalbum.*;
ImageRenderer renderer = currentObject.getRenderer();
if (ImageRenderer.getTypical(renderer.getCloseupRenditions()).getFormat() == OutputFormat.WEBP) {
return false;
}
for (Rendition r : renderer.getCloseupRenditions()) {
if (r.getFormat() == OutputFormat.WEBP) {
return true;
}
}
return false;
}
useFallback = usingFallback() ; %>
</ja:if>
In Groovy I get this:
Making "FB_JustifiedGallery_Simple_groovy" (Changes)
se.datadosen.util.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script715.groovy: 3: Unexpected input: 'usingFallback() {\r\n import' in index.htt at line number 359 at column number 3
at se.datadosen.util.ScriptException.of(ScriptException.java:59)
at se.datadosen.jalbum.ast.ScriptletNode.doEval(ScriptletNode.java:99
How should I solve this?
Edit:
I moved
import net.jalbum.*;
to init.Groovy, but then I get this error:
se.datadosen.util.ScriptException: groovy.lang.MissingMethodException: No signature of method: net.jalbum.script.GroovierScriptEngine.usingFallback() is applicable for argument types: (Script1009$_run_closure1) values: [Script1009$_run_closure1@767eb245] in index.htt at line number 359
at se.datadosen.util.ScriptException.of(ScriptException.java:59)
Edited by: AndreWolff on 3 Nov 2022, 10:53
This is the solution:
<ja:if test="<%= jAlbumVersion > 23 %>">
<%
private usingFallback() {
Edited by: AndreWolff on 3 Nov 2022, 11:14