+ Post New Thread
Results 1 to 8 of 8
Web Development Thread, Creating a graphical Thumbnail of a website by passing a URL in Coding and Web Development; Hello All, I'm currently working on a web based project and I need to be able to create website page ...
  1. #1

    Join Date
    Oct 2006
    Posts
    94
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Creating a graphical Thumbnail of a website by passing a URL

    Hello All,

    I'm currently working on a web based project and I need to be able to create website page thumbnails on the fly using code. Does anyone know of any FREE example code on the web to be able to do this? I would prefer to be able to do this in CGI, Java, PHP, C/C++ on Linux.

    Can anyone provide any pointers?

    TIA!

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Creating a graphical Thumbnail of a website by passing a URL

    thumbnails of images? Here's a function using PHP and GD.

    PHP Code:
    function image_thumbnail($filename) {
    /* This function will take an existing image on the server and render a thumbnail
         image for the website to keep its layout. */
            
    // Set a maximum height and width
    $width 200;
    $height 200;

    // Get new dimensions
    list($width_orig$height_orig) = getimagesize($filename);

    if (
    $width && ($width_orig $height_orig)) {
       
    $width = ($height $height_orig) * $width_orig;
    } else {
       
    $height = ($width $width_orig) * $height_orig;
    }

    // Resample
    $image_p imagecreatetruecolor($width$height);
    $image imagecreatefromjpeg($filename);
    imagecopyresampled($image_p$image0000$width$height$width_orig$height_orig);

    // Output
    imagejpeg($image_p''100);


  3. #3

    Join Date
    Oct 2006
    Posts
    94
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Creating a graphical Thumbnail of a website by passing a URL

    Cheers for that Geoff, but what i'm actually after is a snippet of code that will output a small image of a whole HTML website when you pass it a website url. For example if I pass in http://www.yahoo.co.uk into it I end up with a small image of the yahoo website at that moment in time. I've seen bodged way to do this by running mozilla and using kill processes to take off the nav bars and use an app to snapshot that screen but this takes extra cpu/memory overhead as is a bit clunky.

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Creating a graphical Thumbnail of a website by passing a URL

    Yes, that's all I can find too. html2jpeg:

    http://marginalhacks.com/Hacks/html2jpg/

  5. #5

    Join Date
    Oct 2006
    Posts
    94
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Creating a graphical Thumbnail of a website by passing a URL

    Thanks a lot Geoff!

    I believe this khtml2png will be most useful to me!

    Also, having said that I've just come across a free HTML viewer in Java source, so if khtml2png doesnt do the trick i'm sure I could modify the HTML viewer to render the output as a graphic file.

    I will give them a try and let you know how I get on.

    Many Thanks!


  6. #6

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,422
    Thank Post
    645
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: Creating a graphical Thumbnail of a website by passing a URL

    What about this or this? They're more services than code though.

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    10,051
    Thank Post
    3,582
    Thanked 1,119 Times in 1,024 Posts
    Rep Power
    377

    Re: Creating a graphical Thumbnail of a website by passing a

    Not sure if this helps but opera on the mac does that when you use tabbed browsing Prolly does it on the windows version and other versions too

  8. #8

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,422
    Thank Post
    645
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: Creating a graphical Thumbnail of a website by passing a

    Quote Originally Posted by gecko
    Not sure if this helps but opera on the mac does that when you use tabbed browsing Prolly does it on the windows version and other versions too
    Don't really think that counts...

    I'm currently working on a web based project and I need to be able to create website page thumbnails on the fly using code.



SHARE:
+ Post New Thread

Similar Threads

  1. Creating A School Website With Joomla E-Book
    By in forum Web Development
    Replies: 12
    Last Post: 22nd December 2011, 10:42 AM
  2. Creating a thumbnail from a URL
    By paulpmp4 in forum Scripts
    Replies: 1
    Last Post: 8th August 2007, 06:01 PM
  3. Passing data from dreamweaver to an Access file
    By StewartKnight in forum How do you do....it?
    Replies: 2
    Last Post: 26th January 2007, 12:35 PM
  4. Thumbnail creator
    By alan-d in forum Downloads
    Replies: 0
    Last Post: 7th January 2007, 12:23 AM
  5. Downsides to passing tftp server via 2003 DHCP server?
    By pete in forum Wireless Networks
    Replies: 7
    Last Post: 11th July 2006, 11:07 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •