Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add fallback cover from reading order and refactor default cover service#710

Merged
mickael-menu merged 3 commits intodevelopfrom
cover-fallback-images
Jan 29, 2026
Merged

Add fallback cover from reading order and refactor default cover service#710
mickael-menu merged 3 commits intodevelopfrom
cover-fallback-images

Conversation

Copy link
Member

mickael-menu commented Jan 29, 2026

Added

Shared

  • Publication.cover() now falls back on the first reading order resource if it's a bitmap image and no cover is declared.

mickael-menu added 2 commits January 29, 2026 13:01
Copilot AI review requested due to automatic review settings January 29, 2026 12:16
mickael-menu temporarily deployed to LCP January 29, 2026 12:16 -- with GitHub Actions Inactive
mickael-menu temporarily deployed to LCP January 29, 2026 12:16 -- with GitHub Actions Inactive
Copilot started reviewing on behalf of mickael-menu January 29, 2026 12:17 View session
Copilot AI reviewed Jan 29, 2026
Copy link

Copilot AI left a 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 ResourceCoverService which retrieves covers from the publication container, with fallback to the first bitmap reading order item
  • Made ResourceCoverService the default cover service in PublicationServicesBuilder
  • Updated ImageParser to only set cover links when explicitly declared in ComicInfo.xml
  • Added .avif to the list of bitmap media types
  • Simplified Publication.cover() and Publication.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.

mickael-menu temporarily deployed to LCP January 29, 2026 12:37 -- with GitHub Actions Inactive
mickael-menu temporarily deployed to LCP January 29, 2026 12:37 -- with GitHub Actions Inactive
mickael-menu merged commit 566d13d into develop Jan 29, 2026
5 checks passed
mickael-menu deleted the cover-fallback-images branch January 29, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants