By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

thumbnail image from a web link

P: n/a
Does anyone know of a way of doing this without uploading the image?
Presumably it needs a rendering engine - is such a thing possible. Apologies
if this has already been discussed - I was referred to this group from
elsewhere, but a search for the topic has not unearthed anything.

Cheers,

Ian
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Wed, 4 May 2005 20:46:52 +0100, "Ian King" <ia*****@bigfoot.com> wrote:
Does anyone know of a way of doing this without uploading the image?
Presumably it needs a rendering engine - is such a thing possible. Apologies
if this has already been discussed - I was referred to this group from
elsewhere, but a search for the topic has not unearthed anything.


PHP can grab images from other web servers using file() and so on (provided
fopen_wrappers is on which it usually is, if not there are other ways).
http://uk.php.net/file

The GD functions can resize images in memory
http://uk.php.net/image
http://uk.php.net/manual/en/function...fromstring.php
http://uk.php.net/manual/en/function...yresampled.php

GD works best for line graphics rather than photos, but it will work on photos
anyway; it's fairly commonly installed since it's bundled with PHP.

A better alternative quality- and speed-wise is ImageMagick, but the PHP
module for that is rarely installed so you probably have to spawn an external
process with exec() or similar.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:ai********************************@4ax.com...
On Wed, 4 May 2005 20:46:52 +0100, "Ian King" <ia*****@bigfoot.com> wrote: PHP can grab images from other web servers using file() and so on
(provided
fopen_wrappers is on which it usually is, if not there are other ways).
http://uk.php.net/file

The GD functions can resize images in memory
http://uk.php.net/image
http://uk.php.net/manual/en/function...fromstring.php
http://uk.php.net/manual/en/function...yresampled.php

GD works best for line graphics rather than photos, but it will work on
photos
anyway; it's fairly commonly installed since it's bundled with PHP.

A better alternative quality- and speed-wise is ImageMagick, but the PHP
module for that is rarely installed so you probably have to spawn an
external
process with exec() or similar.

Sorry I probably didn't make my post clear the first time round. I was
wondering if php could grab an image of a web page (rather than from a web
page) This would probably mean some way of making php act as a browser, or
am I barking up the wrong tree?

Done manually, I srcreengrab the borswer page, reduce it to a thmbnail and
upload it.(or upload it and reduce it to a thumbnail using php - there are
disadvantages with either method) I was wondering if there was a way to do
this by "simply" supplying the php script with the web address.

Ian
Jul 17 '05 #3

P: n/a
On Wed, 4 May 2005 21:41:27 +0100, "Ian King" <ia*****@bigfoot.com> wrote:
Sorry I probably didn't make my post clear the first time round. I was
wondering if php could grab an image of a web page (rather than from a web
page) This would probably mean some way of making php act as a browser, or
am I barking up the wrong tree?
Ah - yes it would. Much more awkward.
Done manually, I srcreengrab the borswer page, reduce it to a thmbnail and
upload it.(or upload it and reduce it to a thumbnail using php - there are
disadvantages with either method) I was wondering if there was a way to do
this by "simply" supplying the php script with the web address.


Not the easiest thing to search for either, since most of the keywords come up
with the more common situation of plain image thumbnails.

I can't think of a simple way of doing this, they're all relatively
complicated.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4

P: n/a
*** Ian King wrote/escribió (Wed, 4 May 2005 21:41:27 +0100):
Done manually, I srcreengrab the borswer page, reduce it to a thmbnail and
upload it.(or upload it and reduce it to a thumbnail using php - there are
disadvantages with either method) I was wondering if there was a way to do
this by "simply" supplying the php script with the web address.


Sorry, I don't know the answer. But I know the question: you want to render
a web page from your web server (which also implies, of course, downloading
HTML and linked elements: images, CSS...). What you need is a command line
HTML renderer. If there's a publicly available one, I don't know.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #5

P: n/a
> Does anyone know of a way of doing this without uploading the image?

One way to do it : get the page in a browser, capture the screen, save it as
an image or send the stream without saving. Which means there needs to be a
graphic environnement on the computer doing all this (a server ?). Which
means it is a big problem if you run your web server on a linux machine (as
it is a very bad idea to have a graphic environnement set on a linux web
server). Anyway there are tools doing all this on Windows and on Linux, and
you can call them from PHP using the exec() function. As my web servers
(Linux) do not have a graphic environnement, I use the two first tools from
my Windows machine and then synchronises the data with the online web
server. It works really well ! You can grab a page as it apears on the
screen, chose how big your screen has to be. You can even grab a whole page
in a single image (everything you can see when you scroll the page), and it
even works for pages with Flash (if your web browser has the Flash Player).

Windows :
http://www.html2jpg.com/download.htm (blackbox version)
http://www.guangmingsoft.net/index.htm (HTML Snapshot - bottom of the page)

Linux (Perl script) :
http://marginalhacks.com/Hacks/html2jpg/


Jul 17 '05 #6

P: n/a
> Does anyone know of a way of doing this without uploading the image?

Another idea :
1. html > pdf or html > postscript
2. pdf > image or postscript > image
Jul 17 '05 #7

P: n/a
Ian King wrote:
Does anyone know of a way of doing this without uploading the image?
Presumably it needs a rendering engine - is such a thing possible. Apologies if this has already been discussed - I was referred to this group from elsewhere, but a search for the topic has not unearthed anything.


It's here <news:iq********************@bresnan.com>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.