diff --git a/webapp_utils.py b/webapp_utils.py index 584376529..0db08fc61 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -468,6 +468,16 @@ def _getImageFile(baseDir: str, name: str, directory: str, bannerExtensions = getImageExtensions() bannerFile = '' bannerFilename = '' + for ext in bannerExtensions: + bannerFileTest = name + '.' + ext + bannerFilenameTest = directory + '/' + bannerFileTest + if os.path.isfile(bannerFilenameTest): + bannerFile = name + '_' + theme + '.' + ext + bannerFilename = bannerFilenameTest + return bannerFile, bannerFilename + # if not found then use the default image + theme = 'default' + directory = baseDir + '/' + theme + '/default' for ext in bannerExtensions: bannerFileTest = name + '.' + ext bannerFilenameTest = directory + '/' + bannerFileTest