473,473 Members | 2,309 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating Thumbnail image of a webpage ?

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 !

Thanks
~Prince~

Jun 7 '07 #1
9 4231
Rik
On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
<pr**********@gmail.comwrote:
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.
--
Rik Wasmus
Jun 7 '07 #2
Rik wrote:
On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
<pr**********@gmail.comwrote:
>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.
Jun 7 '07 #3
Rik
On Thu, 07 Jun 2007 19:29:57 +0200, -Lost <ma****************@techie.com>
wrote:
Rik wrote:
>On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
<pr**********@gmail.comwrote:
>>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.
Well, if you have control over a server enabling you to take snapshots
this way, it could be done for sure. PHP is hardly the language to do it
with though. And you wouldn;t need to parse style-declarations etc...
You'd just open a browser on the server and take your snapshot.

Problem is: having a server capable of these things.

--
Rik Wasmus
Jun 7 '07 #4
Rik wrote:
On Thu, 07 Jun 2007 19:29:57 +0200, -Lost
<ma****************@techie.comwrote:
>Rik wrote:
>>On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
<pr**********@gmail.comwrote:

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.

Well, if you have control over a server enabling you to take snapshots
this way, it could be done for sure. PHP is hardly the language to do it
with though. And you wouldn;t need to parse style-declarations etc...
You'd just open a browser on the server and take your snapshot.
Good point.
Problem is: having a server capable of these things.
Exactly! Unless there is some simple exec commands to issue to a Linux
box, I wouldn't even begin to know where to start on that one.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 7 '07 #5
..oO(-Lost)
>Problem is: having a server capable of these things.

Exactly! Unless there is some simple exec commands to issue to a Linux
box, I wouldn't even begin to know where to start on that one.
The very same question was asked some days ago in a German PHP group.
Maybe <news:f3**********@news1.tnib.decan be of some help (requires
Xvfb and kwebdesktop).

Micha
Jun 8 '07 #6
Michael Fesser wrote:
.oO(-Lost)
>>Problem is: having a server capable of these things.
Exactly! Unless there is some simple exec commands to issue to a Linux
box, I wouldn't even begin to know where to start on that one.

The very same question was asked some days ago in a German PHP group.
Maybe <news:f3**********@news1.tnib.decan be of some help (requires
Xvfb and kwebdesktop).
Danke, Michael. However, I do not know how to search with that string
you supplied.

However, was this the post?

http://groups.google.com/group/de.co...954f20382420bd

My German is rusty as hell, but that appears to be the same thing.

Rik, I believe we have a winner! Well, maybe not.

I seriously doubt kwebdesktop would be available on a
commercial/production server, *nix or not. Then again, I am not sure.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 8 '07 #7
On Fri, 08 Jun 2007 04:07:02 +0200, Michael Fesser <ne*****@gmx.de>
wrote:
he very same question was asked some days ago in a German PHP group.
>Maybe <news:f3**********@news1.tnib.decan be of some help (requires
Xvfb and kwebdesktop).
... and here back in April.
Thread; "Web Page Screenshot"
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Jun 8 '07 #8
..oO(-Lost)
>Michael Fesser wrote:
>.oO(-Lost)
>>>Problem is: having a server capable of these things.
Exactly! Unless there is some simple exec commands to issue to a Linux
box, I wouldn't even begin to know where to start on that one.

The very same question was asked some days ago in a German PHP group.
Maybe <news:f3**********@news1.tnib.decan be of some help (requires
Xvfb and kwebdesktop).

Danke, Michael. However, I do not know how to search with that string
you supplied.
Some user agents are able to directly receive the message when you click
on the URL. But you can also copy the message ID (without the 'news:')
in Google Groups' extended search interface.
>However, was this the post?

http://groups.google.com/group/de.co...954f20382420bd
Yep.
>My German is rusty as hell, but that appears to be the same thing.

Rik, I believe we have a winner! Well, maybe not.

I seriously doubt kwebdesktop would be available on a
commercial/production server, *nix or not. Then again, I am not sure.
At least not on a shared host. It would require a dedicated server ...

Micha
Jun 8 '07 #9
On Jun 7, 7:21 am, Prince of Code <princeofc...@gmail.comwrote:
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 !

Thanks
~Prince~

Here is a Perl module that seems germane:
http://search.cpan.org/~psme/Win32-C...0/CaptureIE.pm

JG

Jun 10 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dave Higgins | last post by:
Can the GD library do this? I have an array of numbers (which I shall be manipulating server-side), which I wish to convert into an image. The elements of the array are essentially the 1D...
1
by: Christina | last post by:
How can my ASP serverscript read a JPG file and create a small thumbnail image? I don't mean simple resizing, but true resizing so that the image actually gets smaller in size. Is this possible...
1
by: savvy | last post by:
I want to create a Thumbnail Image from a given large Image and bind it to the Datalist with the datasource being Database. I followed this link given below Creating Thumbnail Images on the fly...
0
by: Ben | last post by:
Hi all, I am trying to write a little app that will generate a thumbnail image of a website. Having searched the web I have found various bits of code that appear to do the job and have written...
8
by: Alexander Fischer | last post by:
Hello, I am writing a gallery script and use imagecreatefromjpeg and fpassthru to output images without any change to them (i.e., no thumbnail creation etc. - just deliver the image via the php...
3
by: tshad | last post by:
oThumbnail.Save is giving me an error: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. theFileName = New FileInfo(strFileName) fileOut =...
3
by: krishnasamy | last post by:
Hi, I have 1.12 Mb size Full size JPEG image. I need convert that image into thumbnail Image. How can I convert the Full size image to Thumbnail image?
0
by: smartic | last post by:
how can i create thumbnail image from flv file i heard about the ffmpeg extension ffor php but i don't know where i can download the file from and how can i use it ? any help will be appreciated :)
2
by: djpaul | last post by:
Hello, I have this program and when i want to load pictures it crashes at the form.showdialog()....??? Here it goes: Private Sub CmbPath_SelectedIndexChanged(ByVal sender As Object, ByVal e As...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.