You are here: Re: Creating Thumbnail image of a webpage ? « PHP Programming Language « IT news, forums, messages
Re: Creating Thumbnail image of a webpage ?

Posted by -Lost on 06/07/07 17:29

Rik wrote:
> On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
> <princeofcode@gmail.com> wrote:
>
>> How do i create a image of webpage in php? Basically what I am looking
>> for is "Create a small image (Thumbnail) of a webpage.
>>
>> Let me know about your thought.
>>
>> Your Help is greatly appreciated !
>
>
> With PHP?
> Very, very tricky. PHP is not a browser, so it has no clue how to handle
> HTML/CSS/etc., so it would have to be told this.
> You could use some code of HTML2PS packages and take it from there.
>
> Depending on how often you need this, just making a screenshot by hand
> is often a far more costeffective solution.

Hrmm... I do not think it would be too tricky.

Using CURL, or fopen, or whatever other method suits you to retrieve the
contents.

Parse script tags and style declarations (making sure to look for
@imports, et cetera).

Then you could fire open a quick instance of whatever browser or COM
instance you desire, fire a snapshot utility, save that and resample
with PHP's image functions, GD or ImageMagick.

This is pretty much what browsershots.org does.

The biggest difficulty that springs to my mind is this is probably not
something that can be done on a shared hosting plan or whatnot. Heck,
maybe not even on a dedicated server unless you are the one who runs it.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация