Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG image "format could not be determined" #2279

Open
nricciardi opened this issue Jul 7, 2024 · 4 comments
Open

SVG image "format could not be determined" #2279

nricciardi opened this issue Jul 7, 2024 · 4 comments

Comments

@nricciardi
Copy link

I'm trying to open and decode SVG image, but error occurs: The image format could not be determined

let image = ImageReader::open(src_pathbuf.clone())?.decode();

I'm on Linux Mint (kernel: 5.15.0-113-generic), in toml: image = "0.24.8"

Following the SVG image which I'm using:

ipv4-packet

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   version="1.1"
   id="svg2"
   xml:space="preserve"
   width="935.79626"
   height="427.02063"
   viewBox="0 0 935.79627 427.02063"
   sodipodi:docname="IPv4_Packet-en.svg"
   inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
     id="metadata8"><rdf:RDF><cc:Work
         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
     id="defs6"><clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath18"><path

[.....]
@fintelia
Copy link
Contributor

fintelia commented Jul 7, 2024

SVG is not one of the currently supported file formats

@nricciardi
Copy link
Author

Is support planned?

@fintelia
Copy link
Contributor

fintelia commented Jul 7, 2024

There are no current plans. Also, SVG is a vector format while all our current formats are raster, so it isn't obvious how support would even work

@Shnatsel
Copy link
Contributor

For loading SVG in Rust see https://github.com/RazrFalcon/resvg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants