mohsinqk / ai-filemetadata
Automatically generates FAL metadata for files by means of public LLMs (Fork with custom changes)
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 9
Type:typo3-cms-extension
pkg:composer/mohsinqk/ai-filemetadata
Requires
- php: >=8.2
- ext-intl: *
- openai-php/client: ^v0.10.1
- typo3/cms-core: ^12 || ^13
Requires (Dev)
- clue/phar-composer: *
- typo3/tailor: ^1.6
Suggests
Replaces
- typo3-ter/ai-filemetadata: *
This package is auto-updated.
Last update: 2026-01-20 18:29:39 UTC
README
Automatically generates FAL metadata (alternative texts, for the time being) for files by means of public LLMs.
This extension helps you to automate the process of generating such alternative texts for images. It serves as a preparation for EU Directive 2019/882 on the accessibility requirements for products and services (German: Barrierefreiheitsstärkungsgesetz (BFSG)).
The extension generates descriptive text for images, making them accessible to visually impaired individuals, e.g. when using screen reader software. It is not intended to create SEO-related texts.
ai_filemetadata.mp4
Video about this extension (in German) is available on Youtube: https://www.youtube.com/watch?v=3nMkxx2E4CE
Important
This extension is processing images from your TYPO3 installation via external AI services. You should check your privacy and data protection policies if the usage of the services for the image data is allowed! Please keep an eye on the license terms of your images, too, as some of them might be restricted from certain applications such as the use of LLM or AI technology.
Prerequisites
- TYPO3 >= v12
- PHP >= 8.2
- OpenAI API key (not to be confused with "ChatGPT Teams" or "ChatGPT Enterprise")
Installation
composer require mfd/ai-filemetadata
Configuration
Acquire the OpenAI API key from Open-AI and place the key in extension configuration. Model for openAI gpt-4o-mini but can be changed to any other modell which supports imageprocessing.
Alternatively setup AI hosting in the mittwald cloud and add the AI Base URL (API) to the configuration and select an active modell
Custom AI Prompt
You can customize the prompt sent to the AI model to generate alternative texts. This allows you to tailor the output to your specific needs or language requirements.
The prompt can be configured in the extension configuration under Alt Text Prompt. The default prompt is:
Create an alternative text for this image to be used on websites for visually impaired people who cannot see the image.
Focus on the image's main content and ignore all elements in the image not relevant to understand its message.
The text should not exceed 50 words.
To customize the prompt:
- Go to Admin Tools > Settings > Extension Configuration
- Select ai_filemetadata
- Modify the Alt Text Prompt field
- Use
\nfor line breaks in your custom prompt
Note: The extension automatically appends language-specific instructions when processing images in different languages based on your language mapping configuration.
Language Mapping
Since folder do not have a relation to any of the sites default languages you might want to define a mapping for certain folders of your storages. You can do so by add this to your system/settings.php:
'EXTCONF' => [ 'ai_filemetadata' => [ 'falLanguageMappings' => [ '1:/site-a/' => [0 => 'en_EN.utf-8', 1 => 'de_DE.utf-8'], '1:/site-b/' => [0 => 'fr_FR.utf-8', 2 => 'en_EN.utf-8'], '1:/site-c/' => [0 => 'de_CH.utf-8', 3 => 'it_CH.utf-8', 4 => 'fr_CH.utf-8'], ], ], ],
This defines the locales being used for each sys_language_uid per folder.
Exclude folders
To exclude certain folders you can use this in your system/settings.php:
'EXTCONF' => [ 'ai_filemetadata' => [ 'falExcludedPrefixes' => [ '1:/site-a/nudes/', ], ], ],
Resize images for LLM processing
Sending large images to OpenAI language models can consume an extremely large number of tokens leading to higher costs, see https://platform.openai.com/docs/guides/images-vision?api-mode=chat#calculating-costs. In most cases, an image size of no more than 512x512px is perfectly adequate for image analysis.
'EXTENSIONS' => [ 'ai_filemetadata' => [ 'imageResizing' => '512', ], ],
CLI command
bin/typo3 ai:generate-alt-texts --path="1:site-a/my-subfolder/" [--overwrite] [--limit=1]
This generates alt texts for all files within the given --path for all available languages. To avoid loading unnecessary translations you might want set a language mapping for certain folders. See chapter above.
Support
Free Support is available via Github Issue Tracker For commercial support, please contact us at info@marketing-factory.de