SVG::Metadata

SVG::Metadata is a Perl module to capture metadata info about an SVG file.
Download

SVG::Metadata Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Bryce Harrington
  • Publisher web site:
  • http://search.cpan.org/~bryce/Test-Parser-1.5/lib/Test/Parser/KernelBuild.pm

SVG::Metadata Tags


SVG::Metadata Description

SVG::Metadata is a Perl module to capture metadata info about an SVG file. SVG::Metadata is a Perl module to capture metadata info about an SVG file.SYNOPSIS use SVG::Metadata; my $svgmeta = new SVG::Metadata; $svgmeta->parse($filename) or die "Could not parse $filename: " . $svgmeta->errormsg(); $svgmeta2->parse($filename2) or die "Could not parse $filename: " . $svgmeta->errormsg(); # Do the files have the same metadata (author, title, license)? if (! $svgmeta->compare($svgmeta2) ) { print "$filename is different than $filename2n"; } if ($svgmeta->title() eq '') { $svgmeta->title('Unknown'); } if ($svgmeta->author() eq '') { $svgmeta->author('Unknown'); } if ($svgmeta->license() eq '') { $svgmeta->license('Unknown'); } if (! $svgmeta->keywords()) { $svgmeta->addKeyword('unsorted'); } elsif ($svgmeta->hasKeyword('unsorted') && $svgmeta->keywords()>1) { $svgmeta->removeKeyword('unsorted'); } print $svgmeta->to_text();This module provides a way of extracting, browsing and using RDF metadata embedded in an SVG file.The SVG spec itself does not provide any particular mechanisms for handling metadata, but instead relies on embedded, namespaced RDF sections, as per XML philosophy. Unfortunately, many SVG tools don't support the concept of RDF metadata; indeed many don't support the idea of embedded XML "islands" at all. Some will even ignore and drop the rdf data entirely when encountered.The motivation for this module is twofold. First, it provides a mechanism for accessing this metadata from the SVG files. Second, it provides a means of validating SVG files to detect if they have the metadata.The motivation for this script is primarily for the Open Clip Art Library (http://www.openclipart.org), as a way of filtering out submissions that lack metadata from being included in the official distributions. A secondary motivation is to serve as a testing tool for SVG editors like Inkscape (http://www.inkscape.org). Requirements: · Perl


SVG::Metadata Related Software