Changeset 22074

Show
Ignore:
Timestamp:
11.05.2010 15:13:50 (9 years ago)
Author:
kjdon
Message:

extrametadata needs the filename with no subfolder as that is added in later. So pass in plain file name to extractEmbeddedMetadata instead of eg folder/file.jpg. Also, don't try and process folders, or each file inside it will get some exif error metadata attached

Files:
1 modified

Legend:

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

    r20927 r22074  
    9797    my $self = shift(@_); 
    9898    my ($file, $filename, $extrametadata, $extrametakeys) = @_; 
    99  
     99  
    100100    my %exif_metadata = (); 
    101101 
     
    159159    # Protect windows directory chars \ 
    160160    $file = &util::filename_to_regex($file); 
    161     # print STDERR "**** file = $file\n"; 
    162  
     161     
    163162    # Associate the metadata now 
    164163 
     
    176175      $processor, $maxdocs, $gli) = @_; 
    177176   
    178  
    179  
    180   # See if we are looking at a PDF file... which may contain EXIF 
    181   my $filename = &util::filename_cat($base_dir, $file); 
    182 #  if ($filename !~ /\.pdf$/i || !-f $filename) 
    183 #    { 
    184 #      return undef; 
    185 #    } 
    186  
     177  my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 
     178   
     179  # we don't want to process directories 
     180  if (!-f $filename_full_path) { 
     181      return undef; 
     182  } 
    187183  print STDERR "\n<Processing n='$file' p='EmbeddedMetadataPlugin'>\n" if ($gli); 
    188184  print STDERR "EmbeddedMetadataPlugin: processing $file\n" if ($self->{'verbosity'}) > 1; 
    189185 
    190186 
    191   $self->extractEmbeddedMetadata($file,$filename, 
     187  $self->extractEmbeddedMetadata($filename_no_path,$filename_full_path, 
    192188                 $extrametadata,$extrametakeys); 
    193189