Add Qt image plugins for AVIF, JXL, and HEIC/HEIF support (Docker) #499
+208
−81
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 Qt Image Plugins for Modern Image Format Support (Docker)
Summary
This PR adds support for modern image formats (AVIF, JXL, HEIC/HEIF) to the YACReaderLibraryServer Docker image using Qt image plugins. No source code changes are required - this follows YACReader's existing plugin architecture as suggested in #498.
Motivation
Modern image formats like AVIF and JPEG XL offer significant advantages:
Users with comics containing these formats currently cannot view them in YACReader, despite the formats becoming more common.
Implementation
This PR follows the maintainer's guidance from #498 to use Qt's dynamic plugin loading system rather than adding custom decoders to the codebase.
Docker Multi-Stage Build (8 Stages)
The updated Dockerfile uses an optimized multi-stage architecture with a shared base layer for maximum build caching and parallelization:
Stage 0-1: Base Layers
Stage 2-5: Independent Plugin Builders (all FROM plugin-base, build in parallel)
Stage 6-7: Assembly
Key Optimizations:
Qt Image Plugins Used
All plugins are from @novomesk's excellent collection:
Note on libjxl: Ubuntu noble ships libjxl 0.7.0, but qt-jpegxl-image-plugin requires 0.10.0+ for
JxlEncoderDistanceFromQuality. We build 0.10.2 from source and merge it with the plugin build in a single optimized stage (stage 4).How It Works
/usr/lib/x86_64-linux-gnu/qt6/plugins/imageformats/QImageReadertransparently uses plugins for supported formatsTesting
Prerequisites
# Pull the updated Docker image docker pull yacreader/yacreader-library-server:latestVerify Format Support
Test with Real Comics
Sample Test Files
Create test CBZ files to verify:
Build Performance
Recent Optimizations (Latest Commit)
The Dockerfile was further optimized to reduce build times and improve caching:
Image Size
Build Time (First Build)
Cached Rebuild
Compatibility
Backwards Compatibility
✅ Fully backwards compatible
Platform Support
Client Support
Server serves native bytes - clients decode using their capabilities.
Changes
Modified Files
docker/Dockerfile- Complete rewrite with multi-stage architectureNo Source Code Changes
Dependencies
New Runtime Dependencies
All dependencies are open source with permissive licenses:
Plugin Licenses
Future Considerations
When libjxl 0.10+ Reaches Ubuntu Repos
Once Ubuntu ships libjxl 0.10.0+:
apt-get install libjxl-devAdditional Formats
More Qt image plugins available:
Same pattern: build plugin, copy to imageformats/, done.
References
Checklist
Note: This PR addresses #498's feedback by using Qt plugins instead of custom decoders. The approach is cleaner, more maintainable, and aligns with YACReader's existing architecture. No source code changes means no risk to existing functionality.