Add FormatBased cover provider - #5613
Open
stweil wants to merge 1 commit into
Open
Conversation
Add a cover content loader that provides a cover image depending on the format of a record (Solr field "format") if none of the other cover providers found one. It is meant to be used as the last entry of the coverimages list in the [Content] section of config.ini. Images are looked up in a configurable directory (image_dir in the new [FormatBasedCovers] section, defaulting to themes/bootstrap5/images/format-covers, which ships a set of simple SVG cover images for the following record formats: Article, Book, Book Chapter, Braille, Conference Proceeding, Database, Dissertation, Electronic, eBook, Globe, Government Document, Journal, Kit, Map, Microfilm, Musical Score, Newspaper, Photo, Physical Object, Serial, Software, Sound Recording, Text, Thesis and Video. Records with any other format (or no format at all) fall back to a generic default image. Explicit per-format mappings and the default image can be configured as well; image paths may be filesystem paths or file:// or http(s) URLs. Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud) Signed-off-by: Stefan Weil <sw@weilnetz.de>
Contributor
Author
|
All cover images in this PR were created by AI (qwen3.8-27b). My test installation uses this code. Stabicat and maybe other VuFind installations also have format based cover images, but I don't know their source code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a cover content loader that provides a cover image depending on the format of a record (Solr field "format") if none of the other cover providers found one. It is meant to be used as the last entry of the coverimages list in the [Content] section of config.ini.
Images are looked up in a configurable directory (image_dir in the new [FormatBasedCovers] section, defaulting to
themes/bootstrap5/images/format-covers, which ships a set of simple SVG cover images for the following record formats:
Article, Book, Book Chapter, Braille, Conference Proceeding,
Database, Dissertation, Electronic, eBook, Globe, Government
Document, Journal, Kit, Map, Microfilm, Musical Score, Newspaper,
Photo, Physical Object, Serial, Software, Sound Recording, Text,
Thesis and Video.
Records with any other format (or no format at all) fall back to a generic default image. Explicit per-format mappings and the default image can be configured as well; image paths may be filesystem paths or file:// or http(s) URLs.
Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)