Changeset 9585


Ignore:
Timestamp:
2005-04-07T15:05:10+12:00 (19 years ago)
Author:
mdewsnip
Message:

Now provides a message through to the GLI on why files are not processed, if running on Windows 95/98 or if ImageMagick isn't installed.

File:
1 edited

Legend:

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

    r9574 r9585  
    145145    my $outhandle = $self->{'outhandle'};
    146146
    147     # None of this works very well on Windows 95/98...
    148     if ($ENV{'GSDLOS'} eq "windows" && !Win32::IsWinNT()) {
    149     print $outhandle "ImagePlug: Windows 95/98 not supported\n" if ($verbosity > 1);
    150     return undef;
    151     }
    152 
    153     # None of this is going to work very well without ImageMagick...
    154     if ($self->{'imagemagick_not_installed'}) {
    155     print $outhandle "ImagePlug: ImageMagick not installed\n" if ($verbosity > 1);
    156     return undef;
    157     }
    158 
    159147    # check the filename is okay
    160148    return 0 if ($file eq "" || $filename eq "");
     
    388376        if $self->{'verbosity'} > 1;
    389377
     378    # None of this works very well on Windows 95/98...
     379    if ($ENV{'GSDLOS'} eq "windows" && !Win32::IsWinNT()) {
     380    if ($gli) {
     381        print STDERR "<ProcessingError n='$file' r='Windows 95/98 not supported'>\n";
     382    }
     383    else {
     384        print $outhandle "ImagePlug: Windows 95/98 not supported\n";
     385    }
     386    return -1;
     387    }
     388
     389    # None of this is going to work very well without ImageMagick...
     390    if ($self->{'imagemagick_not_installed'}) {
     391    if ($gli) {
     392        print STDERR "<ProcessingError n='$file' r='ImageMagick not installed'>\n";
     393    }
     394    else {
     395        print $outhandle "ImagePlug: ImageMagick not installed\n";
     396    }
     397    return -1;
     398    }
     399
    390400    #if there's a leading directory name, eat it...
    391401    $file =~ s/^.*[\/\\]//;
     
    401411    if (!defined $result)
    402412    {
    403     print "ImagePlug: couldn't process \"$filename\"\n";
     413    if ($gli) {
     414        print STDERR "<ProcessingError n='$file'>\n";
     415    }
     416    else {
     417        print $outhandle "ImagePlug: couldn't process \"$filename\"\n";
     418    }
    404419    return -1; # error during processing
    405420    }
     
    413428
    414429    # do plugin specific processing of doc_obj
    415     return -1 unless defined ($self->process (\$text, $pluginfo, $base_dir,
    416                          $file, $metadata, $doc_obj));
     430    unless (defined ($self->process(\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj))) {
     431    print STDERR "<ProcessingError n='$file'>\n" if ($gli);
     432    return -1;
     433    }
    417434
    418435    # do any automatic metadata extraction
Note: See TracChangeset for help on using the changeset viewer.