If you call now setThemeImageProcessor in init.bsh the theme image is always generated, unless of course the theme image has been removed for the current directory.

Calling setThemeImageProcessor in index.htt is not working, because in that case the variables themePath, themeWidth and themeHeight do not get a value.

However if jAlbum offers a function or variable to suppress the generation of the theme image, which can be called in index.htt, you get the possibilities I was looking for like:

Generate a them image only for level 0 folders

Generate a them image only for folders with level >0

Generate a them image only if a folder contains no images

etc.

This should not be too difficult if jAlbum generates the theme images after the execution of the index.htt code, so just before postdir.bsh is called.

Such a function offers an extra possibility: if the suppress function is called jAlbum could investigate whether before a theme image was generated and delete that image in that case, so the potential orphan problem is solved.

Suppressing theme images by skin control on a per-folder basis should be easy, just subclass ThemeImageProcessor and add a boolean setter method that you then call from index.htt for instance. Let the boolean flag control whether to generate theme images or not by checking it in the overridden processThemeImage method.

Well David, it was a long way, but it works now!
Thanks for your help!

But I still recommend that you add this function setActive to the core code and implement the extra possibility: if setActive(false) is called jAlbum should investigate whether before a theme image was generated and delete that image in that case, so the potential orphan problem is also solved.
To give no problems with existing implementations, you should set default setActive(true), so that you only have to call setActive(false) to suppress the generation.