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/PrintIM.pm

    r24107 r34921  
    1313use Image::ExifTool qw(:DataAccess);
    1414
    15 $VERSION = '1.06';
     15$VERSION = '1.07';
    1616
    1717sub ProcessPrintIM($$$);
     
    4343sub ProcessPrintIM($$$)
    4444{
    45     my ($exifTool, $dirInfo, $tagTablePtr) = @_;
     45    my ($et, $dirInfo, $tagTablePtr) = @_;
    4646    my $dataPt = $$dirInfo{DataPt};
    4747    my $offset = $$dirInfo{DirStart};
    4848    my $size = $$dirInfo{DirLen};
    49     my $verbose = $exifTool->Options('Verbose');
     49    my $verbose = $et->Options('Verbose');
    5050
    5151    unless ($size) {
    52         $exifTool->Warn('Empty PrintIM data', 1);
     52        $et->Warn('Empty PrintIM data', 1);
    5353        return 0;
    5454    }
    5555    unless ($size > 15) {
    56         $exifTool->Warn('Bad PrintIM data');
     56        $et->Warn('Bad PrintIM data');
    5757        return 0;
    5858    }
    5959    unless (substr($$dataPt, $offset, 7) eq 'PrintIM') {
    60         $exifTool->Warn('Invalid PrintIM header');
     60        $et->Warn('Invalid PrintIM header');
    6161        return 0;
    6262    }
     
    6868        $num = Get16u($dataPt, $offset + 14);
    6969        if ($size < 16 + $num * 6) {
    70             $exifTool->Warn('Bad PrintIM size');
     70            $et->Warn('Bad PrintIM size');
    7171            return 0;
    7272        }
    7373    }
    74     $verbose and $exifTool->VerboseDir('PrintIM', $num);
    75     $exifTool->HandleTag($tagTablePtr, 'PrintIMVersion', substr($$dataPt, $offset + 8, 4),
     74    $verbose and $et->VerboseDir('PrintIM', $num);
     75    $et->HandleTag($tagTablePtr, 'PrintIMVersion', substr($$dataPt, $offset + 8, 4),
    7676        DataPt => $dataPt,
    7777        Start  => $offset + 8,
     
    8383        my $tag = Get16u($dataPt, $pos);
    8484        my $val = Get32u($dataPt, $pos + 2);
    85         $exifTool->HandleTag($tagTablePtr, $tag, $val,
     85        $et->HandleTag($tagTablePtr, $tag, $val,
    8686            Index  => $n,
    8787            DataPt => $dataPt,
     
    113113=head1 AUTHOR
    114114
    115 Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
     115Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
    116116
    117117This library is free software; you can redistribute it and/or modify it
Note: See TracChangeset for help on using the changeset viewer.