Generate different .bmp for cropped covers so settings have effect. (#330)
Addresses https://github.com/daveallie/crosspoint-reader/pull/225#issuecomment-3735150337
This commit is contained in:
@@ -199,6 +199,7 @@ void SleepActivity::renderCoverSleepScreen() const {
|
||||
}
|
||||
|
||||
std::string coverBmpPath;
|
||||
bool cropped = SETTINGS.sleepScreenCoverMode == CrossPointSettings::SLEEP_SCREEN_COVER_MODE::CROP;
|
||||
|
||||
if (StringUtils::checkFileExtension(APP_STATE.openEpubPath, ".xtc") ||
|
||||
StringUtils::checkFileExtension(APP_STATE.openEpubPath, ".xtch")) {
|
||||
@@ -223,12 +224,12 @@ void SleepActivity::renderCoverSleepScreen() const {
|
||||
return renderDefaultSleepScreen();
|
||||
}
|
||||
|
||||
if (!lastEpub.generateCoverBmp()) {
|
||||
if (!lastEpub.generateCoverBmp(cropped)) {
|
||||
Serial.println("[SLP] Failed to generate cover bmp");
|
||||
return renderDefaultSleepScreen();
|
||||
}
|
||||
|
||||
coverBmpPath = lastEpub.getCoverBmpPath();
|
||||
coverBmpPath = lastEpub.getCoverBmpPath(cropped);
|
||||
} else {
|
||||
return renderDefaultSleepScreen();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user