.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Image::Info::SVG 3" .TH Image::Info::SVG 3 2023-09-08 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Image::Info::SVG \- SVG support for Image::Info .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Image::Info qw(image_info dim); \& \& my $info = image_info("image.svg"); \& if (my $error = $info\->{error}) { \& die "Can\*(Aqt parse image info: $error\en"; \& } \& my $title = $info\->{SVG_Title}; \& \& my($w, $h) = dim($info); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This modules supplies the standard key names except for BitsPerSample, Compression, Gamma, Interlace, LastModificationTime, as well as: .IP ImageDescription 4 .IX Item "ImageDescription" The image description, corresponds to . .IP SVG_Image 4 .IX Item "SVG_Image" A scalar or reference to an array of scalars containing the URI's of embedded images (JPG or PNG) that are embedded in the image. .IP SVG_StandAlone 4 .IX Item "SVG_StandAlone" Whether or not the image is standalone. .IP SVG_Title 4 .IX Item "SVG_Title" The image title, corresponds to .IP SVG_Version 4 .IX Item "SVG_Version" The URI of the DTD the image conforms to. .SH METHODS .IX Header "METHODS" .SS \fBprocess_file()\fP .IX Subsection "process_file()" .Vb 1 \& $info\->process_file($source, $options); .Ve .PP Processes one file and sets the found info fields in the \f(CW$info\fR object. .SH FILES .IX Header "FILES" This module requires either XML::LibXML::Reader or XML::Simple. .SH COMPATIBILITY .IX Header "COMPATIBILITY" Previous versions (until Image\-Info\-1.28) used XML::Simple as the underlying parser. Since Image\-Info\-1.29 the default parser is XML::LibXML::Reader which is much more faster, memory-efficient, and does not rely on regular expressions for some aspects of XML parsing. If for some reason you need the old parser, you can force it by setting the variable \f(CW@Image::Info::SVG::PREFER_MODULE\fR as early as possible: .PP .Vb 2 \& use Image::Info; \& @Image::Info::SVG::PREFER_MODULE = qw(Image::Info::SVG::XMLSimple Image::Info::SVG::XMLLibXMLReader); .Ve .PP The variable \f(CW$Image::Info::SVG::USING_MODULE\fR can be queried to see which parser is in use (after \fBImage::Info::SVG\fR is required). .PP Since 1.38_50 processing of XML external entities (XXE) is not done anymore for security reasons in both backends (\fBImage::Info::SVG::XMLLibXMLReader\fR and \&\fBImage::Info::SVG::XMLSimple\fR). Controlling XXE processing behavior in \fBXML::Simple\fR is not really possible (see <https://rt.cpan.org/Ticket/Display.html?id=83794>), so as a workaround the underlying SAX parser is fixed to XML::SAX::PurePerl which is uncapable of processing external entities — but unfortunately it is also a slow parser. .SH "SEE ALSO" .IX Header "SEE ALSO" Image::Info, XML::LibXML::Reader, XML::Simple, XML::SAX::PurePerl .SH NOTES .IX Header "NOTES" For more information about SVG see <http://www.w3.org/Graphics/SVG/> .PP Random notes: .PP .Vb 10 \& Colors \& # iterate over polygon,rect,circle,ellipse,line,polyline,text for style\->stroke: style\->fill:? \& # and iterate over each of these within <g> too?! and recurse?! \& # append <color>\*(Aqs \& # perhaps even deep recursion through <svg>\*(Aqs? \& ColorProfile <color\-profile> \& RenderingIntent ? \& requiredFeatures \& requiredExtensions \& systemLanguage .Ve .SH AUTHOR .IX Header "AUTHOR" Jerrad Pierce <belg4mit@mit.edu>/<webmaster@pthbb.org> wrote the original code based on XML::Simple .PP Slaven Rezic <srezic@cpan.org> wrote the code using XML::LibXML::Reader .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.