Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with loading cover images. #79

Open
gohanko opened this issue Sep 5, 2020 · 2 comments
Open

Trouble with loading cover images. #79

gohanko opened this issue Sep 5, 2020 · 2 comments

Comments

@gohanko
Copy link

gohanko commented Sep 5, 2020

I tried loading the cover image as per flutter app example, and the library seems to have trouble finding the cover image of the epub file even though it exists (confirmed via other apps and me looking at its meta data).

Here is the code :

Widget buildDocumentItem(epub.EpubBookRef book) {
    return Card(
        child: InkWell(
            splashColor: Colors.black.withAlpha(30),
            onTap: () {

            },
            child: Column(
                children: <Widget>[
                    FutureBuilder<epub.Image>(
                        future: book.readCover(),
                        builder: (context, snapshot) {
                            if (snapshot.hasData) {
                                return Image.memory(image.encodeJpg(snapshot.data));
                            } else if (snapshot.hasError) {
                                return Text("${snapshot.error}");
                            }

                            return Container();
                        }
                    ),
                    Text(book.Title),
                    Text(book.Author),
                ]
            ),
        ),
    );
}

Any idea?

@gohanko
Copy link
Author

gohanko commented Sep 6, 2020

Adding to this, I tried to compile the example's flutter project and reached the same problem with the images of https://www.gutenberg.org/ebooks/11.epub.images and https://www.gutenberg.org/ebooks/19002.epub.images not being displayed.

@angel-afonso
Copy link

I had the same problem for some epub files, I am trying to load the cover image of about 10 e-books and only one of them shows a cover image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants