Ad a own Generator and can handle with WebP and AVIF preview. #1008
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.
Title: Improved AI Input Image Generation with GD
Description:
This change enables the generation of custom input images for AI with better quality using GD for supported image formats. This results in improved recognition accuracy.
Configuration Options:
If the image format is not supported, the standard preview generator is used. Additionally, if the standard preview generator produces a WebP or AVIF image format that the AI cannot process, this image is converted to JPEG using GD.
Considering the known issues with WebP previews, I have created a patch to address these problems and enhance recognition quality:
Please refer to the discussion that led to this Pull Request for more context and insights: #996
The code has been tested on my Nextcloud instance. While I acknowledge that this solution may not be perfect, I couldn't find a better one in a short time. Any suggestions for improvement are highly welcome.