View Full Version : libprs500 and larger cover images from LibraryThing/Amazon


Alexander Turcic
04-03-2008, 03:56 PM
When you fetch a cover image for a book from LibraryThing, it's rather small (140xsomething), causing it to appear very pixelated on the Reader's screen. Now, the images on LibraryThing link to Amazon, and it's easy to change the link to include a larger cover image.

Example:
http://www.librarything.com/work/153691

Links to this cover image:
http://images.amazon.com/images/P/0812575911.01._SX140_SCLZZZZZZZ_.jpg

Removing the SX140 part from the link causes the original large cover image to be downloaded:
http://images.amazon.com/images/P/0812575911.01._SCLZZZZZZZ_.jpg

In fact, knowing how Amazon builds the cover image urls (http://images.amazon.com/images/P/ + IBAN + .01._SCLZZZZZZZ_.jpg), and given the fact that LibraryThing simply links to the Amazon, it could be just as possible to directly download cover images from Amazon without the need to go via LibraryThing first.

kovidgoyal
04-03-2008, 04:09 PM
A good observation. Do you know if the Amazon API is stable?

Alexander Turcic
04-03-2008, 04:22 PM
Kovid, it's not exactly an API but the general image naming scheme Amazon has been using for years. Check out this old blog post from 2005: http://aaugh.com/imageabuse.html

kovidgoyal
04-03-2008, 04:35 PM
Cool, thanks, I'll switch the cover fetching code for the next release.

Alexander Turcic
04-03-2008, 04:55 PM
Cool, thanks, I'll switch the cover fetching code for the next release.

:2thumbsup :D

Alexander Turcic
04-07-2008, 10:14 AM
Kovid, knowing how LibraryThing fetches the cover images (using IBAN code + Amazon URL), wouldn't it make sense to get rid of LibraryThing all together? You could even automatically fetch the cover from the meta info dialog, once the IBAN number has been determined.

kovidgoyal
04-07-2008, 10:59 PM
The problem is that libprs500 uses an ISBN number, which it gets from isbndb.com. Amazon doesn't map all the various ISBN numbers to a cover image. LibraryThing does the mapping for me, which is why the code uses it. If you know how that mapping is done, I'll be happy to get rid of the LibraryThing layer.

Alexander Turcic
04-10-2008, 04:58 PM
Ah, I did not know. Interesting! Do you have an example of a book where a given IBAN does not show the cover image for http://images.amazon.com/images/P/ + IBAN + .01._SCLZZZZZZZ_.jpg?

kovidgoyal
04-11-2008, 08:06 AM
055325121X this is for david brin's uplift i believe.

Alexander Turcic
04-12-2008, 05:55 AM
Weird! You're right, better stick to LibraryThing then ;)