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

    r24107 r34921  
    1616use Image::ExifTool qw(:DataAccess :Utils);
    1717
    18 $VERSION = '1.01';
     18$VERSION = '1.02';
    1919
    2020# PGF header information
     
    6969sub ProcessPGF($$)
    7070{
    71     my ($exifTool, $dirInfo) = @_;
     71    my ($et, $dirInfo) = @_;
    7272    my $raf = $$dirInfo{RAF};
    7373    my $buff;
     
    7676    return 0 unless $raf->Read($buff, 24) == 24 and $buff =~ /^PGF(.)/s;
    7777    my $ver = ord $1;
    78     $exifTool->SetFileType();
     78    $et->SetFileType();
    7979    SetByteOrder('II');
    8080
    8181    # currently support only version 0x36
    8282    unless ($ver == 0x36) {
    83         $exifTool->Error(sprintf('Unsupported PGF version 0x%.2x', $ver));
     83        $et->Error(sprintf('Unsupported PGF version 0x%.2x', $ver));
    8484        return 1;
    8585    }
    8686    # extract information from the PGF header
    8787    my $tagTablePtr = GetTagTable('Image::ExifTool::PGF::Main');
    88     $exifTool->ProcessDirectory({ DataPt => \$buff, DataPos => 0 }, $tagTablePtr);
     88    $et->ProcessDirectory({ DataPt => \$buff, DataPos => 0 }, $tagTablePtr);
    8989
    9090    my $len = Get32u(\$buff, 4) - 16; # length of post-header data
    9191
    9292    # skip colour table if necessary
    93     $len -= $raf->Seek(1024, 1) ? 1024 : $len if $$exifTool{PGFColorMode} == 2;
     93    $len -= $raf->Seek(1024, 1) ? 1024 : $len if $$et{PGFColorMode} == 2;
    9494
    9595    # extract information from the embedded metadata image (PNG format)
    9696    if ($len > 0 and $len < 0x1000000 and $raf->Read($buff, $len) == $len) {
    97         $exifTool->ExtractInfo(\$buff, { ReEntry => 1 });
     97        $et->ExtractInfo(\$buff, { ReEntry => 1 });
    9898    }
    9999    return 1;
     
    120120=head1 AUTHOR
    121121
    122 Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
     122Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
    123123
    124124This library is free software; you can redistribute it and/or modify it
Note: See TracChangeset for help on using the changeset viewer.