style: fix formatting issues in cover generation code

This commit is contained in:
pablohc 2026-01-26 13:47:32 +01:00
parent 5671b05d04
commit 6d6559022c
2 changed files with 5 additions and 3 deletions

View File

@ -484,7 +484,9 @@ bool Epub::generateCoverHomeBmp() const {
// Calculate proportional width for 400px height
const int targetWidth = (400 * jpegWidth) / jpegHeight;
const bool success = JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, homeBmp, targetWidth, HOME_TARGET_HEIGHT);
const bool success =
JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, homeBmp, targetWidth,
HOME_TARGET_HEIGHT);
coverJpg.close();
homeBmp.close();
SdMan.remove(coverJpgTempPath.c_str());

View File

@ -239,8 +239,8 @@ void HomeActivity::render() {
// Use 400px height as specified, with proportional width
constexpr int CARD_HEIGHT = 400;
const int cardWidth = (coverWidth > 0 && coverHeight > 0)
? (CARD_HEIGHT * coverWidth) / coverHeight
: 240; // Fallback to 240px width if no image (maintain aspect ratio)
? (CARD_HEIGHT * coverWidth) / coverHeight
: 240; // Fallback to 240px width if no image (maintain aspect ratio)
const int bookX = (pageWidth - cardWidth) / 2;
constexpr int bookY = 30;