Creating Thumbnail image of a webpage ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prince of Code

    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~

  • Rik

    #2
    Re: Creating Thumbnail image of a webpage ?

    On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
    <princeofcode@g mail.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

    Comment

    • -Lost

      #3
      Re: Creating Thumbnail image of a webpage ?

      Rik wrote:
      On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
      <princeofcode@g mail.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.or g 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.

      Comment

      • Rik

        #4
        Re: Creating Thumbnail image of a webpage ?

        On Thu, 07 Jun 2007 19:29:57 +0200, -Lost <maventheextraw ords@techie.com >
        wrote:
        Rik wrote:
        >On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
        ><princeofcode@ 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

        Comment

        • -Lost

          #5
          Re: Creating Thumbnail image of a webpage ?

          Rik wrote:
          On Thu, 07 Jun 2007 19:29:57 +0200, -Lost
          <maventheextraw ords@techie.com wrote:
          >
          >Rik wrote:
          >>On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code
          >><princeofcode @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.

          Comment

          • Michael Fesser

            #6
            Re: Creating Thumbnail image of a webpage ?

            ..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:f3gsb8$or h$1@news1.tnib. decan be of some help (requires
            Xvfb and kwebdesktop).

            Micha

            Comment

            • -Lost

              #7
              Re: Creating Thumbnail image of a webpage ?

              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:f3gsb8$or h$1@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?



              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.

              Comment

              • David Quinton

                #8
                Re: Creating Thumbnail image of a webpage ?

                On Fri, 08 Jun 2007 04:07:02 +0200, Michael Fesser <netizen@gmx.de >
                wrote:
                he very same question was asked some days ago in a German PHP group.
                >Maybe <news:f3gsb8$or h$1@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.u k/news.html>
                Great gifts: <http://www.ThisBritain .com/ASOS_popup.html >

                Comment

                • Michael Fesser

                  #9
                  Re: Creating Thumbnail image of a webpage ?

                  ..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:f3gsb8$or h$1@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.
                  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

                  Comment

                  • jerrygarciuh

                    #10
                    Re: Creating Thumbnail image of a webpage ?

                    On Jun 7, 7:21 am, Prince of Code <princeofc...@g mail.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:


                    JG

                    Comment

                    Working...