Ignore:
Timestamp:
2021-02-26T19:39:51+13:00 (3 years ago)
Author:
anupama
Message:

Committing the improvements to EmbeddedMetaPlugin's processing of Keywords vs other metadata fields. Keywords were literally stored as arrays of words rather than phrases in PDFs (at least in Diego's sample PDF), whereas other meta fields like Subjects and Creators stored them as arrays of phrases. To get both to work, Kathy updated EXIF to a newer version, to retrieve the actual EXIF values stored in the PDF. And Kathy and Dr Bainbridge came up with a new option that I added called apply_join_before_split_to_metafields that's a regex which can list the metadata fields to apply the join_before_split to and whcih previously always got applied to all metadata fields. Now it's applied to any *Keywords metafields by default, as that's the metafield we have experience of that behaves differently to the others, as it stores by word instead of phrases. Tested on Diego's sample PDF. Diego has double-checked it to works on his sample PDF too, setting the split char to ; and turning on the join_before_split and leaving apply_join_before_split_to_metafields at its default of .*Keywords. File changes are strings.properties for the tooltip, the plugin introducing the option and working with it and Kathy's EXIF updates affecting cpan/File and cpan/Image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cpan/Image/ExifTool/MPC.pm

    r24107 r34921  
    1616use Image::ExifTool::FLAC;
    1717
    18 $VERSION = '1.00';
     18$VERSION = '1.01';
    1919
    2020# MPC metadata blocks
     
    7979sub ProcessMPC($$)
    8080{
    81     my ($exifTool, $dirInfo) = @_;
     81    my ($et, $dirInfo) = @_;
    8282
    8383    # must first check for leading ID3 information
    84     unless ($exifTool->{DoneID3}) {
     84    unless ($$et{DoneID3}) {
    8585        require Image::ExifTool::ID3;
    86         Image::ExifTool::ID3::ProcessID3($exifTool, $dirInfo) and return 1;
     86        Image::ExifTool::ID3::ProcessID3($et, $dirInfo) and return 1;
    8787    }
    8888    my $raf = $$dirInfo{RAF};
     
    9292    $raf->Read($buff, 32) == 32 and $buff =~ /^MP\+(.)/s or return 0;
    9393    my $vers = ord($1) & 0x0f;
    94     $exifTool->SetFileType();
     94    $et->SetFileType();
    9595
    9696    # extract audio information (currently only from version 7 MPC files)
     
    9898        SetByteOrder('II');
    9999        my $pos = $raf->Tell() - 32;
    100         if ($exifTool->Options('Verbose')) {
    101             $exifTool->VPrint(0, "MPC Header (32 bytes):\n");
    102             $exifTool->VerboseDump(\$buff, DataPos => $pos);
     100        if ($et->Options('Verbose')) {
     101            $et->VPrint(0, "MPC Header (32 bytes):\n");
     102            $et->VerboseDump(\$buff, DataPos => $pos);
    103103        }
    104104        my $tagTablePtr = GetTagTable('Image::ExifTool::MPC::Main');
    105105        my %dirInfo = ( DataPt => \$buff, DataPos => $pos );
    106         $exifTool->ProcessDirectory(\%dirInfo, $tagTablePtr);
     106        $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
    107107    } else {
    108         $exifTool->Warn('Audio info not currently extracted from this version MPC file');
     108        $et->Warn('Audio info currently not extracted from this version MPC file');
    109109    }
    110110
    111111    # process APE trailer if it exists
    112112    require Image::ExifTool::APE;
    113     Image::ExifTool::APE::ProcessAPE($exifTool, $dirInfo);
     113    Image::ExifTool::APE::ProcessAPE($et, $dirInfo);
    114114
    115115    return 1;
     
    135135=head1 AUTHOR
    136136
    137 Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
     137Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
    138138
    139139This library is free software; you can redistribute it and/or modify it
Note: See TracChangeset for help on using the changeset viewer.