thumbnail image from a web link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian King

    thumbnail image from a web link

    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


  • Andy Hassall

    #2
    Re: thumbnail image from a web link

    On Wed, 4 May 2005 20:46:52 +0100, "Ian King" <ianking@bigfoo t.com> wrote:
    [color=blue]
    >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.[/color]

    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).
    Reads entire file into an array


    The GD functions can resize images in memory




    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 / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Ian King

      #3
      Re: thumbnail image from a web link


      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:aibi711jfr pa6s32ns6mccp91 99annbj55@4ax.c om...[color=blue]
      > On Wed, 4 May 2005 20:46:52 +0100, "Ian King" <ianking@bigfoo t.com> wrote:[/color]
      [color=blue]
      > 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.
      >[/color]


      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


      Comment

      • Andy Hassall

        #4
        Re: thumbnail image from a web link

        On Wed, 4 May 2005 21:41:27 +0100, "Ian King" <ianking@bigfoo t.com> wrote:
        [color=blue]
        >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?[/color]

        Ah - yes it would. Much more awkward.
        [color=blue]
        >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
        >disadvantage s with either method) I was wondering if there was a way to do
        >this by "simply" supplying the php script with the web address.[/color]

        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 / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • Alvaro G Vicario

          #5
          Re: thumbnail image from a web link

          *** Ian King wrote/escribió (Wed, 4 May 2005 21:41:27 +0100):[color=blue]
          > 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.[/color]

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

          Comment

          • BLob

            #6
            Re: thumbnail image from a web link

            > 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) :





            Comment

            • BLob

              #7
              Re: thumbnail image from a web link

              > 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


              Comment

              • R. Rajesh Jeba Anbiah

                #8
                Re: thumbnail image from a web link

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

                It's here <news:iqWdnQInE f50I2jcRVn-uw@bresnan.com>

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

                Comment

                Working...