Changeset 2207


Ignore:
Timestamp:
2001-03-20T15:58:54+12:00 (23 years ago)
Author:
paynter
Message:

Bugfixes: read returns number of files instead of file type, and options
and usage are made to inherit from BasPlug

File:
1 edited

Legend:

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

    r1758 r2207  
    3434use strict;
    3535
    36 sub print_general_usage {
     36sub print_usage {
    3737    my ($plugin_name) = @_;
    3838
    39     print STDERR "\n  usage: plugin $plugin_name [options]\n\n";
    40     print STDERR "   -noscaleup       Don't scale up small images when making thumbnails\n";
    41     print STDERR "   -thumbnailtype s Make thumbnails in format 's'\n";
    42     print STDERR "   -thumbnailsize n Make thumbnails of size nxn\n";
    43     print STDERR "   -convertto s     Convert main inage to (gif|png|jpg)\n";
    44     print STDERR "   -minimumsize n   Ignore images smaller than n bytes\n";
    45     print STDERR "\n";
     39    print STDERR "
     40  usage: plugin ImagePlug [options]
     41
     42   -noscaleup       Don't scale up small images when making thumbnails
     43
     44   -thumbnailtype s Make thumbnails in format 's'
     45
     46   -thumbnailsize n Make thumbnails of size nxn
     47
     48   -convertto s     Convert main inage to (gif|png|jpg)
     49
     50   -minimumsize n   Ignore images smaller than n bytes
     51
     52"
    4653}
    4754
     
    5057    my $plugin_name = shift (@_);
    5158    my $self = new BasPlug ("ImagePlug", @_);
    52     # general options available to all plugins
    5359
    5460    if (!parsargv::parse(\@_,
     
    6066             "allow_extra_options")) {
    6167   
    62     print STDERR "\nThe $plugin_name plugin uses an incorrect general option (general options are those\n";
    63     print STDERR "available to all plugins). Check your collect.cfg configuration file.\n";
    64         &print_general_usage($plugin_name);
     68    print STDERR "\nImagePlug uses an incorrect option.\n";
     69    print STDERR "Check your collect.cfg configuration file.\n";
     70        &print_usage($plugin_name);
    6571    die "\n";
    6672    }
     
    258264    $doc_obj->set_OID();
    259265
    260 #    $doc_obj->add_text($section, "<pre>\n$text\n</pre>");
     266    # $doc_obj->add_text($section, "<pre>\n$text\n</pre>");
    261267
    262268    # process the document
     
    272278    }
    273279
    274     return $result; # processed the file
     280    return 1;
    275281}
    276282
Note: See TracChangeset for help on using the changeset viewer.