4
  • I want a platform independent utility to take screenshots (not just within the browser).

  • The utility would be able to take screenshots after fixed intervals of time and be easily configurable by the user in terms of

    • time between successive shots,

    • the format the shots are stored,

    • till when (time, event) should the script run, etc

  • Since I need platform independence, I think Perl is a good choice.

a. Before I start out, I want to know whether a similar thing already exists, so I can start from there?

b. Which one of these Perl modules should I use?

Community
  • 1
  • 1
Lazer
  • 90,700
  • 113
  • 281
  • 364
  • What is the scope of your user-configurability? Should they be given the ability to choose the image format the screenshot is saved in? Perhaps what they want to take the screenshot of (whole screen vs active window)? – Zaid Sep 13 '10 at 09:39
  • @Zaid: I am thinking - [time between successive shots, image format, where the images are stored]. Right now, I do not need window based snapshots. – Lazer Sep 13 '10 at 09:45
  • 2
    Try them and find out which one you like more. – brian d foy Sep 13 '10 at 10:21
  • @brian: so, there is no similar existing utility that you know of? – Lazer Sep 13 '10 at 10:26
  • 2
    The way to find out is to try the solutions that are out there and sees what happens. That's how the people who would know the answer found out. – brian d foy Sep 13 '10 at 13:21

1 Answers1

2

Taking a look at the sources of both, Imager::Search isn't much more than a wrapper to Imager::Screenshot.

Here's the constructor:

sub new {
    my $class  = shift;
    my @params = ();
    @params = @{shift()} if _ARRAY0($_[0]);
    my $image = Imager::Screenshot::screenshot( @params );
    unless ( _INSTANCE($image, 'Imager') ) {
        Carp::croak('Failed to capture screenshot');
    }

    # Hand off to the parent class
    return $class->SUPER::new( image => $image, @_ );
}

Given that Imager::Search does not really extend Imager::Screenshot much more, I'd say you're looking at two modules that are essentially the same.

Zaid
  • 36,680
  • 16
  • 86
  • 155