RE: [PHP] thumbnail of webpage

2004-09-22 Thread Warren Vail
I may have found something, a perl script that with all the appropriate
pieces turns a page into a jpg image.

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

from there resizing using GD is a snap.

Warren Vail

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 6:48 PM
To: 'Jason Davidson'; Michael Mao; [EMAIL PROTECTED]
Subject: RE: [PHP] thumbnail of webpage

I have been looking into this over the last week and have come up blank as
well.  Doing this manually is simple, point your browser to your URL, and in
windows use altprint Scrn to copy an image of the rendering in the
browser to the scratch-pad, then paste the image into a tool like paint to
cut out the part of the image you want, and use the skew/stretch tool in
paint to create the thumbnail (GD is a good solution as well) saving the
file as a jpg image.

The difficulties with php is that opening the URL with fopen or using CURL
allows getting the content of a page in html form, but provides no bitmap
rendering of all that, let alone allowing JavaScript to alter the
presentation as it would in a browser.

What would be useful, if there were a way to open the URL in an IFRAME, and
with JavaScript somehow capture a bitmap of the rendering of the web page,
perhaps encoding the bitmap as mod64 characters and placing the result in a
textarea for posting as input to a php script.  This was the best solution
that I could come up with but I don't have the skills to make this happen,
yet.  Question for anyone here, is does this sound like a path that might
work?  Can JavaScript access the rendered content of a webpage in window
bitmap form?

In my travels, someone had suggested coding something using mozilla and
invoking it from a php script, but no one has done this yet that I can
determine.

Warren Vail


-Original Message-
From: Jason Davidson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 6:08 PM
To: Michael Mao; [EMAIL PROTECTED]
Subject: Re: [PHP] thumbnail of webpage


First, im not sure how you would capture a snapshot of the page, sinse the
page is rendered by the browser, and php is completely server side.
Possibly there is a way to fopen a page or something, but... i dunno..

as for making thumbnail, using the gd extension, is quite easy. check the
manual for GD.

Jason


Michael Mao [EMAIL PROTECTED] wrote:

 Is there a way to capture a snapshot of a html page and save it as a
 jpg
 using php?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Ed Curtis

 If you have a Linux box available here's something to try although it
does have some required software.

http://www.babysimon.co.uk/khtml2png/index.html

There is also a link on the site for a commercial product for Windows that
does the same thing.

I can't endorse either one as I have not used them. Just giving the
information.

Ed


On Sat, 18 Sep 2004, raditha dissanayake wrote:

 Michael Mao wrote:

  Is there a way to capture a snapshot of a html page and save it as a
  jpg  using php?
 
 This is something that's very very hard to do with PHP but can be easily
 done with Java.




 --
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 128 KB | with progress bar.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] thumbnail of webpage

2004-09-20 Thread Gryffyn, Trevor
Some great recommendations, but my first thought is wondering if you can
interface with IE via COM or something.   Or open the URL via IE and use
the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to capture it
to the clipboard and do something funny that way.

If I had time right now, I'd love to dig into this, but I wanted to at
least share the thought in case it helped.

Good luck!  Let us know if you find a good way to do this via PHP.

-TG

 -Original Message-
 From: Michael Mao [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 17, 2004 7:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] thumbnail of webpage
 
 
 Is there a way to capture a snapshot of a html page and save 
 it as a jpg  
 using php?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-20 Thread raditha dissanayake
Gryffyn, Trevor wrote:
Some great recommendations, but my first thought is wondering if you can
interface with IE via COM or something.   Or open the URL via IE and use
the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to capture it
to the clipboard and do something funny that way.
 

Good ideas but then you would need to run PHP on the client side and not 
on the server (assuming of course that the original poster is not runnig 
his  server on an OS that does not have any security features).

There was a similar question on 'the list' and someone suggested and 
image magick would be able to do this.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] thumbnail of webpage

2004-09-20 Thread Gryffyn, Trevor
True, you'd have to run it on the web client end, but you can run IE on
the server to access the HTML the server is err..serving.  The server
can also be a client, in other words.  So your server can generate a
thumbnail of what it's serving out by acting as a client for a second.

As long as their security allows them to execute IE or interface with it
and possibly the windows API.

There are complexities, but it's the path I would explore if I had to
create my own thumbnailing system (in the absence of some quick and easy
utility that already did it).

-TG

 -Original Message-
 From: raditha dissanayake [mailto:[EMAIL PROTECTED] 
 Sent: Monday, September 20, 2004 12:28 PM
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] thumbnail of webpage
 
 
 Gryffyn, Trevor wrote:
 
 Some great recommendations, but my first thought is 
 wondering if you can
 interface with IE via COM or something.   Or open the URL 
 via IE and use
 the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to 
 capture it
 to the clipboard and do something funny that way.
 
   
 
 Good ideas but then you would need to run PHP on the client 
 side and not on the server (assuming of course that the original
 poster is not runnig his  server on an OS that does not have any
 security features).
 
 There was a similar question on 'the list' and someone suggested and 
 image magick would be able to do this.
 
 
 -- 
 Raditha Dissanayake.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] thumbnail of webpage

2004-09-20 Thread Stefan Holmes
 -Original Message-
 From: raditha dissanayake [mailto:[EMAIL PROTECTED]
 Sent: 18 September 2004 03:22
 To: Michael Mao
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] thumbnail of webpage
 
 Michael Mao wrote:
 
  Is there a way to capture a snapshot of a html page and save it as a
  jpg  using php?
 
 This is something that's very very hard to do with PHP but can be easily
 done with Java.

I would guess the easiest way would be to find some external program that
retrieves the page and then renders to an image file.  I don't offhand the
names of any utils that do this, but I'm sure there must be at least /one/
available!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Jonathan Haddad

Stefan Holmes wrote:
-Original Message-
From: raditha dissanayake [mailto:[EMAIL PROTECTED]
Sent: 18 September 2004 03:22
To: Michael Mao
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] thumbnail of webpage
Michael Mao wrote:
   

Is there a way to capture a snapshot of a html page and save it as a
jpg  using php?
 

This is something that's very very hard to do with PHP but can be easily
done with Java.
   

I would guess the easiest way would be to find some external program that
retrieves the page and then renders to an image file.  I don't offhand the
names of any utils that do this, but I'm sure there must be at least /one/
available!
 

if you're feeling extremely ambitiious, how about taking the gecko 
source and rendering the result to a PDF or JPG file instead of the 
screen?  come on guys get with it.

Jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] thumbnail of webpage

2004-09-20 Thread Michael Mao
Great link. This tool is exactly what I'm looking for. Thanks!


On Mon, 20 Sep 2004 08:01:15 -0500 (EST), Ed Curtis [EMAIL PROTECTED] wrote:
 
 If you have a Linux box available here's something to try although it
 does have some required software.
 
 http://www.babysimon.co.uk/khtml2png/index.html
 
 There is also a link on the site for a commercial product for Windows that
 does the same thing.
 
 I can't endorse either one as I have not used them. Just giving the
 information.
 
 Ed
 
 
 
 
 On Sat, 18 Sep 2004, raditha dissanayake wrote:
 
  Michael Mao wrote:
 
   Is there a way to capture a snapshot of a html page and save it as a
   jpg  using php?
  
  This is something that's very very hard to do with PHP but can be easily
  done with Java.
 
 
 
 
  --
  Raditha Dissanayake.
  
  http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
  Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
  Graphical User Inteface. Just 128 KB | with progress bar.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-18 Thread Jason Wong
On Saturday 18 September 2004 09:48, Vail, Warren wrote:
 I have been looking into this over the last week and have come up blank as
 well.

A semi-workable was posted in the archives some months ago. Twice.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Ingrate, n.:
A man who bites the hand that feeds him, and then complains of
indigestion.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-18 Thread francesco[AT]automationsoft[DOT]biz
Hi Michael,
read this (in italian)
http://forum.html.it/forum/showthread.php?s=threadid=694523highlight=pillo
la+upload


- Original Message -
From: Michael Mao [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 18, 2004 1:54 AM
Subject: [PHP] thumbnail of webpage


 Is there a way to capture a snapshot of a html page and save it as a jpg
 using php?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-18 Thread Brian V Bonini
On Fri, 2004-09-17 at 22:22, raditha dissanayake wrote:
 Michael Mao wrote:
 
  Is there a way to capture a snapshot of a html page and save it as a 
  jpg  using php?
 
 This is something that's very very hard to do with PHP but can be easily 
 done with Java.

Have not tried this but how about using 'import' which is part of the
ImageMagick package?

According to the man page:

NAME
   import  -  capture some or all of an X server screen and save the
image to a file.

SYNOPSIS
   import [ options ... ] file

DESCRIPTION
   Import reads an image from any visible window on an X server 
and  out-puts  it  as an image file. You can capture a single window,
the entire screen, or any rectangular portion of  the  screen.   Use 
display  for redisplay,  printing, editing, formatting, archiving, image
processing, etc. of the captured image.

   The target window can be specified by id, name, or may be 
selected  by clicking  the  mouse  in  the desired window. If you press
a button and then drag, a rectangle will form which expands  and 
contracts  as  the mouse  moves.  To save the portion of the screen
defined by the rectan- gle, just release the button. The keyboard bell
is  rung  once  at  the beginning of the screen capture and twice when
it completes.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-17 Thread Jason Davidson
First, im not sure how you would capture a snapshot of the page, sinse
the page is rendered by the browser, and php is completely server side.
 Possibly there is a way to fopen a page or something, but... i dunno..

as for making thumbnail, using the gd extension, is quite easy.
check the manual for GD. 

Jason


Michael Mao [EMAIL PROTECTED] wrote: 
 
 Is there a way to capture a snapshot of a html page and save it as a jpg  
 using php?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] thumbnail of webpage

2004-09-17 Thread Vail, Warren
I have been looking into this over the last week and have come up blank as
well.  Doing this manually is simple, point your browser to your URL, and in
windows use altprint Scrn to copy an image of the rendering in the
browser to the scratch-pad, then paste the image into a tool like paint to
cut out the part of the image you want, and use the skew/stretch tool in
paint to create the thumbnail (GD is a good solution as well) saving the
file as a jpg image.

The difficulties with php is that opening the URL with fopen or using CURL
allows getting the content of a page in html form, but provides no bitmap
rendering of all that, let alone allowing JavaScript to alter the
presentation as it would in a browser.

What would be useful, if there were a way to open the URL in an IFRAME, and
with JavaScript somehow capture a bitmap of the rendering of the web page,
perhaps encoding the bitmap as mod64 characters and placing the result in a
textarea for posting as input to a php script.  This was the best solution
that I could come up with but I don't have the skills to make this happen,
yet.  Question for anyone here, is does this sound like a path that might
work?  Can JavaScript access the rendered content of a webpage in window
bitmap form?

In my travels, someone had suggested coding something using mozilla and
invoking it from a php script, but no one has done this yet that I can
determine.

Warren Vail


-Original Message-
From: Jason Davidson [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 17, 2004 6:08 PM
To: Michael Mao; [EMAIL PROTECTED]
Subject: Re: [PHP] thumbnail of webpage


First, im not sure how you would capture a snapshot of the page, sinse the
page is rendered by the browser, and php is completely server side.
Possibly there is a way to fopen a page or something, but... i dunno..

as for making thumbnail, using the gd extension, is quite easy. check the
manual for GD. 

Jason


Michael Mao [EMAIL PROTECTED] wrote: 
 
 Is there a way to capture a snapshot of a html page and save it as a 
 jpg
 using php?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-17 Thread raditha dissanayake
Michael Mao wrote:
Is there a way to capture a snapshot of a html page and save it as a 
jpg  using php?

This is something that's very very hard to do with PHP but can be easily 
done with Java.


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] thumbnail of webpage

2004-09-17 Thread Curt Zirzow
* Thus wrote Michael Mao:
 Is there a way to capture a snapshot of a html page and save it as a jpg  
 using php?

As you can see this isn't an easy task.  One possiblity is to ask
the mozilla/gecko developers if it would be possible to to create a
library that would render a page into a bitmap.

If that is the case then PHP would be able to do what you need very
easily.


Curt
-- 
The above comments may offend you. flame at will.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-17 Thread Brad Pauly
 Michael Mao wrote:
 
  Is there a way to capture a snapshot of a html page and save it as a
  jpg  using php?

This is a bit of a hack, but kinda neat if you don't mind setting it
up. I'm sure you could use php to call a script anyway. Heh.

http://www.livejournal.com/users/brad/2015327.html

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php