Skip to content

fix: dynamic continue reading card sizing based on cover image#683

Closed
pablohc wants to merge 1 commit intocrosspoint-reader:masterfrom
pablohc:fix/home-continue-reading-card
Closed

fix: dynamic continue reading card sizing based on cover image#683
pablohc wants to merge 1 commit intocrosspoint-reader:masterfrom
pablohc:fix/home-continue-reading-card

Conversation

@pablohc
Copy link
Contributor

@pablohc pablohc commented Feb 3, 2026

Original Issue: #348

Summary

  • What is the goal of this PR?
  • Adapt card width to cover image aspect ratio when available
  • Maintain fixed 400px height for consistent layout
  • Use actual image dimensions instead of hardcoded 240px width for EPUBs
  • Add fallback to half-screen size when no cover image exists
  • Parameter correction to avoid rendering artifacts
  • What changes are included?
  • HomeActivity.cpp: Dynamic logic to adapt the card width according to the cover's aspect ratio
  • Epub.cpp: Calculation of dynamic dimensions based on the actual dimensions of the JPG image
  • JpegToBmpConverter.cpp: Parameter correction to avoid rendering artifacts based on fix fix: Artifacts on Thumb on Home Screen #662

Additional Context

Continue Reading Card

v0.16.0 artifacts / fixed size card:
IMG20260203122332

Fix #662 without artifacts / fixed size card:
IMG20260203120651

This PR without artifacts / dinamic card width:
IMG20260203120959


AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? < YES >

- Adapt card width to cover image aspect ratio when available
- Maintain fixed 400px height for consistent layout
- Use actual image dimensions instead of hardcoded 240px width for EPUBs
- Add fallback to half-screen size when no cover image exists
@lukestein
Copy link
Contributor

Seems to work great for me. Thank you! 🎉

Not pictured here, but also seems to work as expected for me with XTC files, text files, and EPUBs without a cover.

Old vs. New images (example 1)

IMG_3185

IMG_3188

Old vs. New images (example 2)

IMG_3186

IMG_3187

@pablohc
Copy link
Contributor Author

pablohc commented Feb 3, 2026

Seems to work great for me. Thank you! 🎉

Not pictured here, but also seems to work as expected for me with XTC files, text files, and EPUBs without a cover.

Thanks @lukestein!! ;)

The "Continue Reading" card has the same aspect ratio as the screen, half the width and height, so the covers of XTC files scale without any noticeable difference from before. ePubs without covers use the same card size.
If the XTC format saves the cover dimensions somewhere, we could obtain the original proportions and create a new PR where we crop the cover and avoid white borders on all four sides.

@pablohc
Copy link
Contributor Author

pablohc commented Feb 19, 2026

Conflicts solved in PR #990

@pablohc pablohc closed this Feb 19, 2026
daveallie pushed a commit that referenced this pull request Feb 20, 2026
## Summary

* **What is the goal of this PR?** 
* **What changes are included?**

- Adapt card width to cover image aspect ratio in Classic theme
- Increase homeTopPadding from 20px to 40px to avoid overlap with
battery icon
- Card width now calculated from BMP dimensions instead of fixed 240px
- Maximum card width limited to 90% of screen width
- Falls back to original behavior (half screen width) when no cover
available

## Additional Context

* Solve conflicts in PR #683 

Before:
<img width="1052" height="1014" alt="image"
src="https://github.com/user-attachments/assets/6c857913-d697-4e9e-9695-443c0a4c0804"
/>

PR:

![Screenshot_2026-02-19-14-22-36-68_99c04817c0de5652397fc8b56c3b3817](https://github.com/user-attachments/assets/81505728-d42e-41bd-bd77-44848e05b1eb)


---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_
daveallie pushed a commit that referenced this pull request Feb 20, 2026
## Summary

* **What is the goal of this PR?** 
* **What changes are included?**

- Adapt card width to cover image aspect ratio in Classic theme
- Increase homeTopPadding from 20px to 40px to avoid overlap with
battery icon
- Card width now calculated from BMP dimensions instead of fixed 240px
- Maximum card width limited to 90% of screen width
- Falls back to original behavior (half screen width) when no cover
available

## Additional Context

* Solve conflicts in PR #683 

Before:
<img width="1052" height="1014" alt="image"
src="https://github.com/user-attachments/assets/6c857913-d697-4e9e-9695-443c0a4c0804"
/>

PR:

![Screenshot_2026-02-19-14-22-36-68_99c04817c0de5652397fc8b56c3b3817](https://github.com/user-attachments/assets/81505728-d42e-41bd-bd77-44848e05b1eb)


---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 20, 2026
## Summary

* **What is the goal of this PR?** 
* **What changes are included?**

- Adapt card width to cover image aspect ratio in Classic theme
- Increase homeTopPadding from 20px to 40px to avoid overlap with
battery icon
- Card width now calculated from BMP dimensions instead of fixed 240px
- Maximum card width limited to 90% of screen width
- Falls back to original behavior (half screen width) when no cover
available

## Additional Context

* Solve conflicts in PR crosspoint-reader#683 

Before:
<img width="1052" height="1014" alt="image"
src="https://github.com/user-attachments/assets/6c857913-d697-4e9e-9695-443c0a4c0804"
/>

PR:

![Screenshot_2026-02-19-14-22-36-68_99c04817c0de5652397fc8b56c3b3817](https://github.com/user-attachments/assets/81505728-d42e-41bd-bd77-44848e05b1eb)


---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_
@pablohc pablohc deleted the fix/home-continue-reading-card branch February 27, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants