Re: SVG to PNG
Pro Turm <[email protected]> Sat, 14 Nov 2020 01:22:20 +0100
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <CADC9rU-zfFs_EVzAzqO6Db9v+EOELdZpnYRpDzecVn=NOkN-oQ@mail.gmail.com> |
(StaticModules[index].name_length == name_length) My problem is the above line (346) in static.c. The name_length is 7 (svg+xml), which is the mime type of the svg, whereas the StaticModules.name_length is 3 - SVG. Since this is the case, the module is not registered, and svg doesnt work. I can bruteforcefully fix it (by adjusting the string in StaticModules), but I want to understand how it is intended to work? > (normally SVG can be automatically identified) How is this done automatically? Are there any examples? How about documentation? Am Fr., 13. Nov. 2020 um 20:23 Uhr schrieb Bob Friesenhahn < [email protected]>: > On Fri, 13 Nov 2020, Pro Turm wrote: > > > PS Am I missing something: the mime type of svg+xml > > > > STATICM doesnt use the mime type svg+xml, but only svg and so > > BlobToImage->GetMagickInfo->OpenModule->register_fn > > is never called > > > > A bug or what did I miss _? > > These are "magick" strings which identify the file format internally. > They are not MIME types. > > The "magick" string is determined in several ways, such as inspecting > the file header for clues, the file extension, or using prefix such as > "SVG:filename". > > For example, > > 'gm convert file.svg file.gif' > > or > > 'gm convert svg:file file.gif' > > If one has a blob of data which can't be automatically identified > (normally SVG can be automatically identified), then the 'magick' > member of ImageInfo can be updated with a string similar to "SVG". > Likewise, if you know that the file is SVG but it somehow can not be > determined, then ImageInfo's 'filename' property can be specified like > "SVG:filename". > > In magick/magick.c you will find the MagickToMime() function which > goes the other way and converts from a magick string to a MIME string. > For example "svg" is equivalent to "image/svg+xml". > > Bob > -- > Bob Friesenhahn > [email protected], http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ > Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt > > > _______________________________________________ > Graphicsmagick-help mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help > _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help