Ignore:
Timestamp:
2017-06-22T17:41:38+12:00 (7 years ago)
Author:
ak19
Message:

Further changes to new UnknownConverterPlugin that's still in progress. Now I can at least run pluginfo.pl on the plugin to get a description of it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm.bak

    r31743 r31744  
    3333no strict 'refs'; # allow filehandles to be variables and viceversa
    3434
     35use ConvertBinaryFile;
     36use UnknownPlugin;
    3537
    3638# TO DO:
     
    3840# - Have a TEMPDIR placeholder in the command, which, if present, gets replaced with the usual tempdir location
    3941# of a collection, and in which case we have to clean up intermediate files generated in there at the end?
     42# Add a check that the generated file or files generated in the output dir match the convert_to option selected
     43# before trying to process them
    4044
    4145sub BEGIN {
     
    4953    'desc' => "{ConvertBinaryFile.convert_to.html}" },
    5054      { 'name' => "pagedimg_jpg",
    51     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_jpg}" },
     55    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_jpg}" },
    5256      { 'name' => "pagedimg_gif",
    53     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_gif}" },
     57    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_gif}" },
    5458      { 'name' => "pagedimg_png",
    55     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_png}" }
     59    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_png}" }
    5660      ];
    5761
     
    118122    push(@$specific_options, "-processing_tmp_files");
    119123    }
     124    elsif ($secondary_plugin_name eq "PagedImagePlugin") {
     125    push(@$specific_options, "-screenviewsize", "1000");
     126    push(@$specific_options, "-enable_cache");
     127    push(@$specific_options, "-processing_tmp_files");
     128    }
    120129
    121130    # bless again, copied from PDFPlugin, PowerPointPlugin
    122131    $self = bless $self, $class;
    123     $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists;)
     132    $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists);
    124133    return $self;
    125134}
     
    175184    # replace occurrences of '*' placeholder in cmd string with input filename
    176185    my ($tailname, $dir, $suffix) = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
    177     $cmd ~= s/\*/$tailname/g;
     186    $cmd =~ s/\*/$tailname/g;
    178187    print STDERR "@@@@ $plugin_name: executing conversion cmd $cmd\n";
    179188    my $status = system($cmd);
Note: See TracChangeset for help on using the changeset viewer.