epub_cover_extractor v0.1.2 EpubCoverExtractor
Documentation for EpubCoverExtractor. Handle the logic of getting the cover from the Epub archive
Link to this section Summary
Functions
Open the EPUB archive and get the ebook cover
Link to this section Functions
Link to this function
get_cover(epub)
Open the EPUB archive and get the ebook cover
Examples
EpubCoverExtractor.get_cover("doesnotexist")
{:error, :enoent}
{:ok, binary} = EpubCoverExtractor.get_cover("book.epub")
{:ok,
<<137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73,
72, 68, 82, 0, 0, 5, 130, 0, 0, 8, 202, 8, 6, 0, 0,
0, 43, 176, 122, 217, 0, 0, 0, 9, 112, 72, 89, 115,
0, 0, 14, 196, 0, 0, 14...>>}
File.write("cover.png", binary)