feat: add inline jpg and png images to epub
This commit is contained in:
@@ -324,6 +324,10 @@ void Epub::setupCacheDir() const {
|
||||
}
|
||||
|
||||
SdMan.mkdir(cachePath.c_str());
|
||||
|
||||
// Create images subdirectory
|
||||
const auto imagesDir = cachePath + "/images";
|
||||
SdMan.mkdir(imagesDir.c_str());
|
||||
}
|
||||
|
||||
const std::string& Epub::getCachePath() const { return cachePath; }
|
||||
@@ -353,6 +357,11 @@ std::string Epub::getCoverBmpPath(bool cropped) const {
|
||||
return cachePath + "/" + coverFileName + ".bmp";
|
||||
}
|
||||
|
||||
std::string Epub::getImageCachePath(const int spineIndex, const int imageIndex) const {
|
||||
const auto imagesDir = cachePath + "/images";
|
||||
return imagesDir + "/" + std::to_string(spineIndex) + "_" + std::to_string(imageIndex) + ".bmp";
|
||||
}
|
||||
|
||||
bool Epub::generateCoverBmp(bool cropped) const {
|
||||
// Already generated, return true
|
||||
if (SdMan.exists(getCoverBmpPath(cropped).c_str())) {
|
||||
|
||||
Reference in New Issue
Block a user