PyBites-Open-Source / pybitesbooks

30 stars 19 forks source link

[bug] Google Books API does not return large image for all books #11

Open bbelderbos opened 4 years ago

bbelderbos commented 4 years ago

For example: http://pbreadinglist.herokuapp.com/books/k1gzDwAAQBAJ Image link: http://books.google.com/books?id=k1gzDwAAQBAJ&printsec=frontcover&img=1&zoom=2&source=gbs_gdata

I played a bit with it but did not find a consistent / reliable way to always get a big image for a book using Google Books API (= what we use for this project), nor other book APIs.

karlangadas commented 4 years ago

16

Hi! I've made a pr with a solution for this bug. Hope it helps.

bbelderbos commented 4 years ago

Thanks @karlangadas, awesome you took this up. I will test it out locally. What happens if a smaller image gets stored, will it impact the book's page design?

karlangadas commented 4 years ago

In that case the image will be centered. You can see how it looks like with this book: NQzBJwAACAAJ.

image

On the other hand, I couldn't test it on the slack view. Let me know if there is something to fix on the design for this view. I could get the slack api in order to solve it.

bbelderbos commented 4 years ago

@karlangadas that is neat! I will try it later on my end and merge it in. Thanks

bbelderbos commented 4 years ago

@karlangadas if you have time could you check why some books are not resizing please? http://pbreadinglist.herokuapp.com/books/EzBqBgAAQBAJ (others examples: gVcATKTpirEC and __CvAFrcWY0C) Thanks!