ebooklib
ebooklib copied to clipboard
get image content to show from epub .
I want to show images from epub file. I used the default example and I need to get content image to show into PyQt4
import ebooklib
from ebooklib import epub
book = epub.read_epub('my_example.epub')
for a in book.get_items_of_type(ebooklib.ITEM_IMAGE):
print a
The result come with : EpubImage:id66:images/00146.jpeg
You can use .get_content() method to get content of the image. So just do
for a in book.get_items_of_type(ebooklib.ITEM_IMAGE): image_raw = a.get_content()
Variable image_raw will have raw content of the image.