Changeset 16827 for gsdl/trunk/perllib/plugins/PagedImagePlugin.pm
- Timestamp:
- 2008-08-15T15:35:32+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/PagedImagePlugin.pm
r16384 r16827 192 192 push(@{$hashArgOptLists->{"OptList"}},$options); 193 193 194 new ImageConverter($pluginlist, $inputargs, $hashArgOptLists); 195 new ReadTextFile($pluginlist, $inputargs, $hashArgOptLists, 1); 196 my $self = new ReadXMLFile($pluginlist, $inputargs, $hashArgOptLists); 197 194 my $imc_self = new ImageConverter($pluginlist, $inputargs, $hashArgOptLists); 195 my $rtf_self = new ReadTextFile($pluginlist, $inputargs, $hashArgOptLists, 1); 196 my $rxf_self = new ReadXMLFile($pluginlist, $inputargs, $hashArgOptLists); 197 198 my $self = BasePlugin::merge_inheritance($imc_self,$rtf_self,$rxf_self); 199 200 # Update $self used by XML::Parser so it finds callback functions 201 # such as start_document here and not in ReadXMLFile (which is what 202 # $self was when new XML::Parser was done) 203 # 204 # If the $self returned by this constructor is the same as the one 205 # used in ReadXMLFile (e.g. in the GAPlugin) then this step isn't necessary 206 # 207 # Consider embedding this type of assignment into merge_inheritance 208 # to help catch all cases? 209 210 $rxf_self->{'parser'}->{'PluginObj'} = $self; 211 198 212 return bless $self, $class; 199 213 } … … 227 241 228 242 return q^(?i)(\.jpe?g|\.gif|\.png|\.tif?f|\.te?xt|\.html?|~)$^ 243 ### return q^(?i)(\.jpe?g|\.gif|\.png|\.tif?f|\.te?xt|\.html?|\.css|\.opd|\.pdf|~)$^ 229 244 } 230 245 … … 233 248 { 234 249 my $self = shift (@_); 250 235 251 $self->BasePlugin::read(@_); 236 252 } … … 241 257 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 242 258 my $outhandle = $self->{'outhandle'}; 259 my $verbosity = $self->{'verbosity'}; 243 260 244 261 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 245 262 246 263 print $outhandle "PagedImagePlugin processing \"$filename_full_path\"\n" 247 if $ self->{'verbosity'}> 1;264 if $verbosity > 1; 248 265 print STDERR "<Processing n='$file' p='PagedImagePlugin'>\n" if ($gli); 249 266 … … 354 371 my ($filename_full_path, $filename_no_path, $doc_obj, $section, $rotate) = @_; 355 372 # do rotation 356 if ($rotate eq "r") {373 if ((defined $rotate) && ($rotate eq "r")) { 357 374 # check the filenames 358 375 return 0 if ($filename_no_path eq "" || !-f $filename_full_path); … … 393 410 my ($imgfile) = $_{'imgfile'}; 394 411 if (defined $imgfile) { 395 $self->process_image($self->{'base_dir'}.$imgfile, $imgfile, $doc_obj, $self->{'current_section'}); 412 # ***** 413 # What about support for rotate image (e.g. old ':r' notation)? 414 $self->process_image($self->{'xml_file_dir'}.$imgfile, $imgfile, $doc_obj, $self->{'current_section'}); 396 415 } 397 416 my ($txtfile) = $_{'txtfile'}; 398 417 if (defined($txtfile)&& $txtfile ne "") { 399 $self->process_text ($self->{' base_dir'}.$txtfile, $txtfile, $doc_obj, $self->{'current_section'});418 $self->process_text ($self->{'xml_file_dir'}.$txtfile, $txtfile, $doc_obj, $self->{'current_section'}); 400 419 } else { 401 420 $self->add_dummy_text($doc_obj, $self->{'current_section'}); … … 450 469 451 470 my ($dir, $file) = $self->{'filename'} =~ /^(.*?)([^\/\\]*)$/; 452 $self->{' base_dir'} = $dir;471 $self->{'xml_file_dir'} = $dir; 453 472 $self->{'num_pages'} = 0; 454 473 … … 578 597 579 598 580 if ($text =~ m/<html.*?>\s*<head.*?>.*<\/head>\s*<body.*?>(.*)<\/body>\s*<\/html>\s*$/ s) {599 if ($text =~ m/<html.*?>\s*<head.*?>.*<\/head>\s*<body.*?>(.*)<\/body>\s*<\/html>\s*$/is) { 581 600 # looks like HTML input 582 601 # no need to escape < and > or put in <pre> tags
Note:
See TracChangeset
for help on using the changeset viewer.