Menu

Include Picture of the book

2005-07-27
2013-05-30
  • Nobody/Anonymous

    Hi folks!
    What about including pictures of the books? The following code may be used:

    $isbn = 1565926812;
    list($Width) = @getimagesize("http://images.amazon.com/images/P/" . $isbn . ".01.MZZZZZZZ.jpg");
    if ($Width > 1)
    {
    echo "Image Exists";
    }
    else
    {
    echo "No Image Found";
    }

    But how storing these pics locally? This would improve the performance (of amazon's servers as well)
    Could anyone of the "developement cracks" include this piece of code into OpenBiblio?

     
    • Micah Stetson

      Micah Stetson - 2005-07-27

      Pulling images from Amazon is a really neat idea, and I know a lot of Open Source software does it.  But I worry about legal issues.  I have two questions:  What does Amazon think about it?  And, perhaps more importantly, have the copyright holders given permission for everyone to make and distribute copies of the cover art?

      My client librarians disagree about whether it's legal to scan images of books you own for display in an online catalog.  Taking those images directly from another web site has even more problems.  I definitely wouldn't want to put something like this in the main OpenBiblio distribution without a clear word from Amazon: it might be seen as encouraging our users to break the law.

      Perhaps somebody could maintain a patch that we linked to with some kind of disclaimer telling users that the legalities were their own responsibility.

      Micah

       
      • Andreas Weller

        Andreas Weller - 2005-07-28

        Hi!
        It seems this would be legal if you register for the Amazon WebServices and use their API:
        Visit for details:
        http://www.amazon.com/gp/browse.html/ref=sc_fe_c_1_3434651_4/104-4373679-8039143?%5Fencoding=UTF8&node=3440661&no=3434651&me=A36L942TSJ2AJA
        Only limitation is: 1query/second - but if you register new books in OpenBiblio - I think now one will be faster :-)

        The same was discussed for an other program here: http://mail.gnome.org/archives/rhythmbox-devel/2005-May/msg00172.html

        Regards,
          Andreas Weller

         
        • Micah Stetson

          Micah Stetson - 2005-07-28

          Thanks for the pointers.  I read their license agreement, and it isn't very clear about it.  In fact, there are several passages that, if taken literally, would seem to prohibit any kind of web application from doing anything useful with their API.  But I don't seriously think that's what they mean.

          What it does say clearly is that it is our responsibility to make sure that we aren't violating anybody's copyrights (section 3).  That means we're back at square one: is it legal to redistribute cover art or not?  A small thumbnail might be fair use, but I'm not confident of that.

          There are also other problems: we have to be sure we don't access the service more than once per second or 10,000 times per day at max, and we can't cache images for longer than 24 hours.  That means that we couldn't just download the images when we add items -- we'd have to have some code to manage the cache and make sure we updated often enough that we didn't hit the 24 hour cache limit but seldom enough that we didn't hit the 10,000 per day max queries.

          So here's the conclusion: it still might not be legal, and a quick little hack cannot be guaranteed to comply with their license agreement.  I still say it would be a good add-on with a disclaimer saying that each site had to decide for itself about the legalities.

          Micah

           
    • Nobody/Anonymous

      I fairly certain there is not an issue to having links to other sites. While it might be an issue to load their images onto your own site maintaining a link as a marc format resource (tag 856) and building code to display the resource can't seriously be viewed as an issue. AXA

       
    • Andreas Weller

      Andreas Weller - 2005-07-29

      I'm trying to include it to shared/biblio_search.php but having problems to derive the ISBN number.
      I'd like to include the pic in line 260.
      The media type picture is included there using:
      <img src="../images/<?php echo $materialImageFiles[$biblio->getMaterialCd()];?>" width="20" height="20" border="0" align="bottom" alt="<?php echo $materialTypeDm[$biblio->getMaterialCd()];?>">
      How do I get the ISBN number of the current media? I know it's stored using USMarc and I think I have to use the printUsmarcText function for this. But I don't know how to use it :-(

      Regards,
        Andreas Weller

       
      • Micah Stetson

        Micah Stetson - 2005-08-03

        You don't need to use printUsmarcText, that just displays the name of a particular MARC field, not its value for a particular record.

        The tricky thing about what you need to do is that BiblioSearchQuery doesn't return Biblios, but BiblioSearches.  They don't directly give you access to the MARC fields.  You'll need to use BiblioQuery to retrieve the Biblio for each bibid you get out of a BiblioSearch.  Then call $biblio->getBiblioFields() to retrieve the MARC fields.  This will return an array with indexes like '020a' for field '020', subfield 'a'.  '020a' is the ISBN number.  For more on the mechanics of BiblioQuery and such, take a look at shared/biblio_view.php.  If you have any more questions, don't hesitate to ask.

        This will all change in 0.6.0, but I don't know when that will be ready.  It should be simpler, anyway.

        Micah

         

Log in to post a comment.