Skip to content

Set Thumbnail file / Preview Picture #125

@Progi1984

Description

@Progi1984

By default, this folder contains the files app.xml (for application properties such as word count and program version) and core.xml (for document properties such as the Document Properties summary information like author and subject). Additionally, if you use the options to save a preview picture or a thumbnail for your document, you see a thumbnail image file in the docProps folder. For Word 2007 and Excel 2007, this will be a .wmf file and for PowerPoint 2007 it will be a jpeg file.

# http://cpansearch.perl.org/src/EXIFTOOL/Image-ExifTool-9.70/lib/Image/ExifTool/OOXML.pm
# process only XML and JPEG/WMF thumbnail images in "docProps" directory
next unless $file =~ m{^docProps/(.*\.xml|(thumbnail\.(jpe?g|wmf)))$}i;
# get the file contents (CAREFUL! $buff MUST be local since we hand off a value ref)
my ($buff, $status) = $zip->contents($member);
$status and $et->Warn("Error extracting $file"), next;
# extract docProps/thumbnail.(jpg|mwf) as PreviewImage|PreviewMWF
if ($file =~ /\.(jpe?g|wmf)$/i) {
    my $tag = $file =~ /\.wmf$/i ? 'PreviewWMF' : 'PreviewImage';
    $et->FoundTag($tag, \$buff);
    next;
}
<manifest:file-entry manifest:full-path="Thumbnails/thumbnail.png" manifest:media-type="image/png"/>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions