PHP Webthumb API wrapper

Over the weekend Hansin wrote a PHP Webthumb API wrapper and released in under open source. Webthumb seems to be handling the load pretty well, its already generated 2600+ thumbnails today.

So if you want an easy way to generate webpage thumbnails right from your PHP applications now you have one.

I’ll be looking at some various rate limits and queue adjustments over the next week to keep one user from clogging up the queue too much. Until then be nice, and enjoy.

16 thoughts on “PHP Webthumb API wrapper”

  1. An awesome tool for easy going php developers. We love API and we love their good implementation. Good work Hasin !

  2. The API doesn’t work:

    Fatal error: Call to undefined method Job::quote() in /home/htdocs/jeichorn/ on line 40



  3. Hello, i’m a frenchy 😉 i found this script code on search engine.
    It’s look so nice and adapted to my needs.I try to make it alone, and i put img.php usage.php and Webthumb.class.php on my ftp server.
    I had an api and replace on the 2 files $wb->setApi(“…………”);
    on img.php and usage.php . After i launch usage.php and nothing happends.
    No message, no pictures. i make a mistake maybe ?
    i took my api on the section of user of .
    Thanks to tell me what i miss…And thanks for great programmer.

  4. No matter how I try with this API wrapper or directly I am having no luck resetting the browser to 800×600 before the grab. I am using:


    But it always comes back as 1024×768 – can you help?

  5. Try again… replace the curly brackets with triangle ones…


  6. Oh oh sorry but is it the right way to install the script on my ftp ? why nothing happens no creation of class ? Thanks to tell please.

  7. Linkerman:
    I didn’t write the PHP wrapper, so im not sure what its doing error handling wise.

    But i know it uses the curl extension so if you don’t have that, you might be getting an error like that.

    On the webthumb server side of things im just recieving http requests and sending reponses.

  8. Thanks for your answer, i’ve got php Version 4.4.4 i saw the date of creation of function on this page
    I think the script php should work on my server, but i don’t know how.
    i just wanted to send request with an url and get the url of thumbnails 80×60 back on my page.I just know little things about xml language i’m a novice.Can i use just javascript that could send you request with the info found here ?
    a script like this could be possible ? what can i add ?
    And where enter the message xml from your information api.txt

    function go()
    var xhr_object = null;

    if(window.XMLHttpRequest) // Firefox
    xhr_object = new XMLHttpRequest();
    else if(window.ActiveXObject) // Internet Explorer
    xhr_object = new ActiveXObject(“Microsoft.XMLHTTP”);
    else {
    alert(“Navigator don’t support XMLHTTPRequest…”);
    }“GET”, http://…, false);
    if(xhr_object.readyState == 4) alert(“Request Done !”);

    Thanks a lot…

  9. Hi,

    thanks a lot for the tutorial. Since my web server doesn’t have libcurl I wrote the following class using the PEAR package HTTP_request:

    private function _executeHttpRequest($request) {
    $req =& new HTTP_Request($this->_request_uri);
    $req->addHeader(‘Content-Type:’, ‘application/xml’);

    $response = $req->sendRequest();

    if (PEAR::isError($response)) {
    echo $response->getMessage();
    } else {
    //echo $req->getResponseBody();
    return $req->getResponseBody();

    It works quite finde, but I’m having another problem:

    When the script asks the server for the current status after 5 seconds, the server returns the error “Cross dependency found in OUTER JOIN; examine your ON conditions” instead of an XML message such as …. I guess it’s got something to do with the database… But despite this error the requested screenshot is shown on the homepage of

    Does anyone have any idea?

    Thanks in advance,


Comments are closed.