Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts

    How do they get this screen image ?

    Hi,
    I have seen website thumbnails around the web
    and now I would like to dynamically create them based on
    the url.

    Here is an example of the HTML that
    generates one

    PHP Code:
    echo "<img src=\"http://cb-analytics.com/product-thumb.php?id=FARMVILLE\" 
    width='300px' height='200px' alt='Thumbnail for FARMVILLE'  border='2'>"

    And here is it running: Test Picture

    How do these people get the screen image ?

    What is in the product-thumb.php ?

    I have the GD library on my server but I don't know how to
    proceed with this one !

    Can anyone help me out ?

    Thanks


    .
    Last edited by jeddi; 01-28-2010 at 11:01 AM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    hgs
    hgs is offline
    New Coder
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    83
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Look there

    http://phpthumb.gxdlabs.com/

    Regards

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks for the link, but I can use gd to
    resample, resize images etc. so I am not looking
    for a thumbnail generator as such,
    but to learn the method of building a dynamic website
    thumbnail generator like the one shown in my first post.




    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    jeddi ...
    I think you're talking about grabbing a URL's screenshot?

    You need to have your own server to do that.
    There is no way to have a script load a website, render it, and take a picture of the screen.

    But with your own server, you can do it using some C++ or other software installed within the server.
    That's typically what sites like this do:
    http://www.browsrcamp.com/

    Browsrcamp uses a Mac operating system (server) to render a website ... showing
    what it actually looks like on the Mac Safari browser.

    EDIT:
    You can also have your own online server ... but at a cost:
    https://www.godaddy.com/gdshop/hosti...ted-server.asp

    It would be cheaper to use an online service (API) to get your screenshots:
    http://www.thumbalizr.com/


    .
    Last edited by mlseim; 01-28-2010 at 02:17 PM.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    There are actually ways to do this with PHP now. You would not be doing this on request, rather going once and capturing the image, maybe doing that every few weeks or months. Look into the imagegrabscreen and imagegrabwindow (windows only). Frankly, this is a lot easier with the imagegrabwindow; the imagegrabscreen would need cropping to fit it in, and I'm betting that most servers will not let you do this. Cropping is honestly the easiest part, what you need to do is execute a command to open a browser, navigate to the site, wait for it to complete, then capture the image.

    Check out the imagegrabwindow. On a personal server with windows on it, this is the easiest route. The api actually has an example showing you how to use a COM object for doing an IE screenshot.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #6
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks for the input.

    I did find a solution and it probably works great
    but it only runs on windows servers because as you said
    the procedure needs to open a browser.
    That solution opens IE.

    I do run a server but it is CentOS Linux 5.4
    so I can not use that solution

    I will look into imagegrabwindow anyway.

    Thanks.

    OK - read it.

    Looks great ... untill ...
    Note: This function is only available on Windows.
    So I guess those websites that are doing this url screen rendering
    are probably running a windows server ?



    .
    Last edited by jeddi; 01-29-2010 at 10:10 AM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

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