-
Notifications
You must be signed in to change notification settings - Fork 202
Add fallback cover from reading order and refactor default cover service#710
Merged
mickael-menu merged 3 commits intodevelopfrom Jan 29, 2026
Merged
Add fallback cover from reading order and refactor default cover service#710mickael-menu merged 3 commits intodevelopfrom
mickael-menu merged 3 commits intodevelopfrom
Conversation
... reading order resource if it's a bitmap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a default cover service (ResourceCoverService) that automatically determines the cover image when no explicit cover link is provided, and refactors the ImageParser to no longer set the first reading order item as the cover by default.
Changes:
- Added
ResourceCoverServicewhich retrieves covers from the publication container, with fallback to the first bitmap reading order item - Made
ResourceCoverServicethe default cover service inPublicationServicesBuilder - Updated
ImageParserto only set cover links when explicitly declared in ComicInfo.xml - Added
.avifto the list of bitmap media types - Simplified
Publication.cover()andPublication.coverFitting()helpers to delegate entirely to the cover service
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/Shared/Publication/Services/Cover/ResourceCoverService.swift | New service that retrieves covers with fallback to first bitmap reading order item |
| Sources/Shared/Publication/Services/Cover/CoverService.swift | Simplified cover helpers to always use a CoverService |
| Sources/Shared/Publication/Services/PublicationServicesBuilder.swift | Made ResourceCoverService the default cover service |
| Sources/Streamer/Parser/Image/ImageParser.swift | Only sets cover rel when explicitly declared in ComicInfo.xml |
| Sources/Shared/Toolkit/Format/MediaType.swift | Added AVIF to bitmap media types |
| Tests/SharedTests/Publication/Services/Cover/CoverServiceTests.swift | Comprehensive tests for ResourceCoverService fallback behavior |
| Tests/StreamerTests/Parser/Image/ImageParserTests.swift | Updated test to verify no cover rel is set by default |
| Tests/SharedTests/Publication/Services/PublicationServicesBuilderTests.swift | Updated service counts to account for default ResourceCoverService |
| Support/Carthage/Readium.xcodeproj/project.pbxproj | Added ResourceCoverService.swift to build |
| Support/Carthage/.xcodegen | Added ResourceCoverService.swift to sources |
| CHANGELOG.md | Documented the new fallback behavior |
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.