| 25 | bool ReaderActivity::isBmpFile(const std::string& path) { return FsHelpers::hasBmpExtension(path); } |
| 26 | |
| 27 | std::unique_ptr<Epub> ReaderActivity::loadEpub(const std::string& path) { |
| 28 | if (!Storage.exists(path.c_str())) { |
| 29 | LOG_ERR("READER", "File does not exist: %s", path.c_str()); |
| 30 | return nullptr; |
| 31 | } |
| 32 | |
| 33 | auto epub = makeUniqueNoThrow<Epub>(path, "/.crosspoint"); |
| 34 | if (!epub) { |
| 35 | LOG_ERR("READER", "Failed to allocate EPUB object"); |
| 36 | return nullptr; |
| 37 | } |
| 38 | if (epub->load(true, SETTINGS.embeddedStyle == 0)) { |
| 39 | return epub; |
| 40 | } |
| 41 | |
| 42 | LOG_ERR("READER", "Failed to load epub"); |
| 43 | return nullptr; |
| 44 | } |
| 45 | |
| 46 | std::unique_ptr<Xtc> ReaderActivity::loadXtc(const std::string& path) { |
| 47 | if (!Storage.exists(path.c_str())) { |