Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-28-2010, 10:58 AM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,544
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
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


.
__________________
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.

Last edited by jeddi; 01-28-2010 at 11:01 AM..
jeddi is offline   Reply With Quote
Old 01-28-2010, 11:08 AM   PM User | #2
hgs
New Coder

 
Join Date: Jan 2010
Location: Germany
Posts: 52
Thanks: 1
Thanked 2 Times in 2 Posts
hgs is on a distinguished road
Look there

http://phpthumb.gxdlabs.com/

Regards
hgs is offline   Reply With Quote
Old 01-28-2010, 11:43 AM   PM User | #3
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,544
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
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.
jeddi is offline   Reply With Quote
Old 01-28-2010, 02:12 PM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,056
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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..
mlseim is offline   Reply With Quote
Old 01-28-2010, 03:35 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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'); 
Fou-Lu is offline   Reply With Quote
Old 01-29-2010, 10:05 AM   PM User | #6
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,544
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
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 ...
Quote:
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 ?



.
__________________
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.

Last edited by jeddi; 01-29-2010 at 10:10 AM..
jeddi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:05 AM.


Advertisement
Log in to turn off these ads.