Crates.io | is-svg |
lib.rs | is-svg |
version | |
source | src |
created_at | 2024-07-13 22:55:51.117511 |
updated_at | 2024-07-13 22:55:51.117511 |
description | Test whether a given data is a SVG image |
homepage | |
repository | https://github.com/sorairolake/is-svg |
max_upload_size | |
id | 1302654 |
size | 0 |
is-svg is a Rust library for testing whether a given data is a SVG image.
Add this to your Cargo.toml
:
[dependencies]
is-svg = "0.1.0"
assert_eq!(
is_svg::is_svg(include_str!("../tests/data/image.svg")),
true
);
assert_eq!(
is_svg::is_svg(include_bytes!("../tests/data/image.png")),
false
);
// `.svgz` is also supported.
assert_eq!(
is_svg::is_svg(include_bytes!("../tests/data/image.svgz")),
true
);
See the documentation for more details.
The minimum supported Rust version (MSRV) of this library is v1.74.0.
Please see CHANGELOG.adoc.
Please see CONTRIBUTING.adoc.
Copyright © 2024 Shun Sakai (see AUTHORS.adoc)
This library is distributed under the terms of either the Apache License 2.0 or the MIT License.
This project is compliant with version 3.2 of the REUSE Specification. See copyright notices of individual files for more details on copyright and licensing information.