New Webthumb feature, Easythumb

Updated
WebThumb added a new feature this week called Easythumb. Like the rest of webthumb its still in beta but it makes adding thumbnails too a site much easier.

Easythumb gives you a simple interface to WebThumb letting people with minimal PHP skills integrate WebThumb into there site. It does have a couple drawbacks, thumbnails are always cached (if someone else requested that same url within 24 hours then you get that thumb instead of making a new request), the output sizes are smaller, and some other options won’t be available.

Easythumb lets you generate a thumbnail using an normal http GET call, letting you put the request right in an img src. Easythumb thumbs are always cached, the default cache is 1 day, you can also use a 7 day and 30 day cache.

If a thumbnail is served from the cache it only use 1/5 of a credit
If the thumbnail is generated it uses 1 credit like normal

Note that currently Easythumb only generates thumbnails of sizes small, medium, and medium2

I have a small example script that shows Easythumbs usage it uses a little JavaScript trick to add a loading message. To use it on your site you just need to register a webthumb account. Copy this sample where you want it and update the parameters.


< ?php
// configuration parameters
$url = 'http://bluga.net/webthumb'; // make a thumbnail of this url
$apikey = 'your api key here';
$userId = 1; // your user id here
$date = gmdate('Ymd');
$size = 'medium';
$cache = 1;
$messageId = "tmessage1";

$parameters = "user=$userId&url=".urlencode($url)."&hash=".md5($date.$url.$apikey)."&size=$size&cache=$cache";
?>
<html>
<head>
        <title>Easy Thumb Sample</title>

<style type="text/css">
.thumbnail {
        position: relative;
}
.thumbnailMessage {
        position: absolute;
        top: 0;
        left: 0;
        width: 160px;
        height: 120px;
        background: gray;
        text-align: center;
}
</style>
</head>
<body>

<div class="thumbnail">
<img src="http://webthumb.bluga.net/easythumb.php?<?php echo $parameters; ?/>"
        title="Generated Thumbnail" width=160 height=120
        onload="document.getElementById('< ?php echo $messageId; ?>').style.display = 'none'"
>
<div class="thumbnailMessage" id="<?php echo $messageId; ?>">
Your thumbnail is being generated please wait
</div>
</div>

</body>
</html>


7 Responses to “New Webthumb feature, Easythumb”

  1. 1

    Joshua Eichorn’s Blog: New Webthumb feature, Easythumb…

  2. 2

    Fantastic that was thati was waiting for, it works perfectly, thanks to programmers.Have a nice day.

  3. 3

    [...] don’t forgot about the EasyThumb api, its a very simple to use API and would be great for Wordpress search plus thumbnails or [...]

  4. 4

    Hi Joshua,

    This looks to be a fantastic service and API.

    I have a database on my blog of semantic Web tools that I want to loop over and display a thumbnail of each site. (See http://www.mkbergman.com/?page_id=325). Can you suggest a modification to your script that would work for this purpose? (I want to pass an internal url in the database to the $url PHP parameter.) I also really only need to cache every 30 days; do you have documentation on the script parameters?

    Thanks for this neat service!

    Mike

  5. 5

    Mike: There is an XML REST API to do that sort of thing. There is a nice PHP wrapper at http://devzone.zend.com/node/view/id/1069

  6. 6

    Hi, it isnt working at my page. If i check ist, asythumb.php always says: “Bad Hash”. Is somehting changes? Please help! Thanks!

  7. 7

    Michael: Email me josh@bluga.net and we i’ll help you debug, things should be working, the test scripts are all working fine.


Leave a Reply

This circle expands additional navigation