How to make thumbnail image from web page?

Discussion in 'Perl Misc' started by Trenk, Dec 5, 2007.

  1. Trenk

    Trenk Guest

    Trenk, Dec 5, 2007
    #1
    1. Advertising

  2. Trenk

    Marthan Guest

    Marthan, Dec 5, 2007
    #2
    1. Advertising

  3. Trenk

    Martina Guest

    Martina, Dec 5, 2007
    #3
  4. On 2007-12-05 09:39, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
    > Trenk wrote:
    >> How to make thumbnail image from web page?
    >> Some thing like networksolutions.com do.
    >> eg. http://www.networksolutions.com/whois/results.jsp?domain=perl.com
    >>
    >> Tnx.
    >>
    >>

    >
    > Render, then subsample.

    ^^^^^^
    That's the interesting part. How do you render a web-page into a
    pixmap? Subsampling is trivial.

    hp
    Peter J. Holzer, Dec 5, 2007
    #4
  5. On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
    <> wrote:

    >> Render, then subsample.

    > ^^^^^^
    > That's the interesting part. How do you render a web-page into a
    >pixmap? Subsampling is trivial.


    I saw the question discussed recently. I can't remember whether here
    or at PerlMonks. (Most probably, tertium non datur.) Off the top of my
    memory, and probably in a sloppy way, options include (i) use a
    rendering engine like gecko, or (ii) launch a browser and take a
    screenshot. IIRC both actions can be automated in perl.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
    Michele Dondi, Dec 6, 2007
    #5
  6. On 2007-12-06 10:15, Michele Dondi <> wrote:
    > On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
    ><> wrote:
    >>> Render, then subsample.

    >> ^^^^^^
    >> That's the interesting part. How do you render a web-page into a
    >>pixmap? Subsampling is trivial.

    >
    > I saw the question discussed recently. I can't remember whether here
    > or at PerlMonks. (Most probably, tertium non datur.) Off the top of my
    > memory, and probably in a sloppy way, options include (i) use a
    > rendering engine like gecko,


    Provided the rendering engine can render into a pixmap instead of a
    window at all, and that it can be used from Perl.

    > or (ii) launch a browser and take a screenshot. IIRC both actions can
    > be automated in perl.


    This limits you to the size of the browser window. Which is probably
    what you want for a thumbnail, but I was thinking in a more general way
    (sorry for not mentioning the shift in focus).

    hp
    Peter J. Holzer, Dec 8, 2007
    #6
  7. On Sat, 8 Dec 2007 11:45:55 +0100, "Peter J. Holzer"
    <> wrote:

    >> I saw the question discussed recently. I can't remember whether here
    >> or at PerlMonks. (Most probably, tertium non datur.) Off the top of my
    >> memory, and probably in a sloppy way, options include (i) use a
    >> rendering engine like gecko,

    >
    >Provided the rendering engine can render into a pixmap instead of a
    >window at all, and that it can be used from Perl.
    >
    >> or (ii) launch a browser and take a screenshot. IIRC both actions can
    >> be automated in perl.

    >
    >This limits you to the size of the browser window. Which is probably
    >what you want for a thumbnail, but I was thinking in a more general way
    >(sorry for not mentioning the shift in focus).


    As I wrote, I vaguely remember a discussion from people who do know
    far better than me. Of course I may be entirely wrong.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
    Michele Dondi, Dec 8, 2007
    #7
  8. "Peter J. Holzer" <> wrote in
    news::

    > On 2007-12-06 10:15, Michele Dondi <> wrote:
    >> On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
    >><> wrote:
    >>>> Render, then subsample.
    >>> ^^^^^^
    >>> That's the interesting part. How do you render a web-page into a
    >>>pixmap? Subsampling is trivial.

    >>
    >> I saw the question discussed recently. I can't remember whether here
    >> or at PerlMonks. (Most probably, tertium non datur.) Off the top of
    >> my memory, and probably in a sloppy way, options include (i) use a
    >> rendering engine like gecko,

    >
    > Provided the rendering engine can render into a pixmap instead of a
    > window at all, and that it can be used from Perl.
    >
    >> or (ii) launch a browser and take a screenshot. IIRC both actions can
    >> be automated in perl.

    >
    > This limits you to the size of the browser window. Which is probably
    > what you want for a thumbnail, but I was thinking in a more general
    > way (sorry for not mentioning the shift in focus).


    There is a plugin for Firefox called Screengrab which I use. It is able
    to take a snapshot of the entire contents of the browser window (not the
    window decorations, though). Its source code might provide some clues.

    Alternatively, on Win32, I would try to use Win32::GuiTest to scroll the
    window as necessary (it is not obvious to me how I would figure that
    out), take repeated snapshots using IrfanView and stitch them

    Sinan

    --
    A. Sinan Unur <>
    (remove .invalid and reverse each component for email address)
    clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
    A. Sinan Unur, Dec 8, 2007
    #8
  9. On 2007-12-08 12:44, A. Sinan Unur <> wrote:
    > "Peter J. Holzer" <> wrote in
    > news::
    >
    >> On 2007-12-06 10:15, Michele Dondi <> wrote:
    >>> On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
    >>><> wrote:
    >>>>> Render, then subsample.
    >>>> ^^^^^^
    >>>> That's the interesting part. How do you render a web-page into a
    >>>>pixmap? Subsampling is trivial.

    [...]
    >>> or (ii) launch a browser and take a screenshot. IIRC both actions can
    >>> be automated in perl.

    >>
    >> This limits you to the size of the browser window. Which is probably
    >> what you want for a thumbnail, but I was thinking in a more general
    >> way (sorry for not mentioning the shift in focus).

    >
    > There is a plugin for Firefox called Screengrab which I use. It is able
    > to take a snapshot of the entire contents of the browser window (not the
    > window decorations, though).


    Ah, that's a nice one. Didn't know that.

    hp
    Peter J. Holzer, Dec 8, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi
    Replies:
    1
    Views:
    496
    john smith
    Feb 1, 2006
  2. dodgeyb
    Replies:
    1
    Views:
    613
    George Ter-Saakov
    Dec 14, 2007
  3. Chris Pine
    Replies:
    1
    Views:
    87
    Tim Hunter
    Jul 18, 2004
  4. Replies:
    9
    Views:
    113
    Piyush Ranjan
    Nov 30, 2007
  5. Blue
    Replies:
    6
    Views:
    100
    Erik Wasser
    Jun 6, 2006
Loading...

Share This Page