Changeset 31744
- Timestamp:
- 2017-06-22T17:41:38+12:00 (6 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm.bak
r31743 r31744 33 33 no strict 'refs'; # allow filehandles to be variables and viceversa 34 34 35 use ConvertBinaryFile; 36 use UnknownPlugin; 35 37 36 38 # TO DO: … … 38 40 # - Have a TEMPDIR placeholder in the command, which, if present, gets replaced with the usual tempdir location 39 41 # 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 40 44 41 45 sub BEGIN { … … 49 53 'desc' => "{ConvertBinaryFile.convert_to.html}" }, 50 54 { 'name' => "pagedimg_jpg", 51 'desc' => "{ {ConvertBinaryFile.convert_to.pagedimg_jpg}" },55 'desc' => "{ConvertBinaryFile.convert_to.pagedimg_jpg}" }, 52 56 { 'name' => "pagedimg_gif", 53 'desc' => "{ {ConvertBinaryFile.convert_to.pagedimg_gif}" },57 'desc' => "{ConvertBinaryFile.convert_to.pagedimg_gif}" }, 54 58 { 'name' => "pagedimg_png", 55 'desc' => "{ {ConvertBinaryFile.convert_to.pagedimg_png}" }59 'desc' => "{ConvertBinaryFile.convert_to.pagedimg_png}" } 56 60 ]; 57 61 … … 118 122 push(@$specific_options, "-processing_tmp_files"); 119 123 } 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 } 120 129 121 130 # bless again, copied from PDFPlugin, PowerPointPlugin 122 131 $self = bless $self, $class; 123 $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists ;)132 $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists); 124 133 return $self; 125 134 } … … 175 184 # replace occurrences of '*' placeholder in cmd string with input filename 176 185 my ($tailname, $dir, $suffix) = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$"); 177 $cmd ~=s/\*/$tailname/g;186 $cmd =~ s/\*/$tailname/g; 178 187 print STDERR "@@@@ $plugin_name: executing conversion cmd $cmd\n"; 179 188 my $status = system($cmd); -
main/trunk/greenstone2/perllib/strings.properties
r31496 r31744 1266 1266 TextPlugin.title_sub:Substitution expression to modify string stored as Title. Used by, for example, PostScriptPlugin to remove "Page 1" etc from text used as the title. 1267 1267 1268 UnknownConverterPlugin.desc:If you have a custom conversion tool installed that you're able to run from the command line to convert from an unsupported document format to either text or HTML, provide that command to this Plugin and it will run the command for you, capturing the output for indexing by Greenstone, making your document searchable. Use * as placeholder for input file name, but specify suffix of file to be converted (and also of any output file generated, if a file and not dir of files is generated). 1269 1270 UnknownConverterPlugin.exec_cmd:Command line command string to execute that will do the conversion. 1271 1272 UnknownConverterPlugin.output_file_or_dir_name: Full pathname of the output file or of the directory (of output files) that get generated by the conversion 1273 1268 1274 UnknownPlugin.assoc_field:Name of the metadata field that will hold the associated file's name. 1269 1275
Note:
See TracChangeset
for help on using the changeset viewer.