Changeset 8145


Ignore:
Timestamp:
2004-09-24T10:38:06+12:00 (20 years ago)
Author:
mdewsnip
Message:

Check for ImageMagick being installed and on the path, and bail early if it isn't.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/ImagePlug.pm

    r8121 r8145  
    107107    }
    108108
     109    # Check that ImageMagick is installed and available on the path
     110    my $result = `identify 2>&1`;
     111    if ($? == -1 || $? == 256) {  # Linux and Windows return different values for "program not found"
     112    $self->{'imagemagick_not_installed'} = 1;
     113    }
     114
    109115    return bless $self, $class;
    110116}
     
    129135    my $verbosity = $self->{'verbosity'};
    130136    my $outhandle = $self->{'outhandle'};
     137
     138    # None of this is going to work very well without ImageMagick...
     139    if ($self->{'imagemagick_not_installed'}) {
     140    print $outhandle "ImagePlug: ImageMagick not installed\n" if ($verbosity > 1);
     141    return undef;
     142    }
    131143
    132144    # check the filename is okay
Note: See TracChangeset for help on using the changeset viewer.