{"id":13694019,"url":"https://github.com/h2non/go-is-svg","last_synced_at":"2025-04-19T18:49:08.223Z","repository":{"id":57487303,"uuid":"69397293","full_name":"h2non/go-is-svg","owner":"h2non","description":"Check if a given buffer is a valid SVG image in Go (golang)","archived":false,"fork":false,"pushed_at":"2016-09-27T21:24:56.000Z","size":33,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T11:25:44.733Z","etag":null,"topics":["svg"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h2non.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-27T20:47:55.000Z","updated_at":"2024-06-25T10:09:08.000Z","dependencies_parsed_at":"2022-09-02T00:01:21.035Z","dependency_job_id":null,"html_url":"https://github.com/h2non/go-is-svg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2non%2Fgo-is-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2non%2Fgo-is-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2non%2Fgo-is-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2non%2Fgo-is-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h2non","download_url":"https://codeload.github.com/h2non/go-is-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249769442,"owners_count":21323066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["svg"],"created_at":"2024-08-02T17:01:22.578Z","updated_at":"2025-04-19T18:49:08.204Z","avatar_url":"https://github.com/h2non.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["图形处理","Graphics Processing"],"readme":"# go-is-svg [![Build Status](https://travis-ci.org/h2non/go-is-svg.png)](https://travis-ci.org/h2non/go-is-svg) [![GoDoc](https://godoc.org/github.com/h2non/go-is-svg?status.svg)](https://godoc.org/github.com/h2non/go-is-svg) [![Coverage Status](https://coveralls.io/repos/github/h2non/go-is-svg/badge.svg?branch=master)](https://coveralls.io/github/h2non/go-is-svg?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/h2non/go-is-svg)](https://goreportcard.com/report/github.com/h2non/go-is-svg)\n\nTiny package to verify if a given file buffer is an SVG image in Go (golang).\n\nSee also [filetype](https://github.com/h2non/filetype) package for binary files type inference.\n\n## Installation\n\n```bash\ngo get -u github.com/h2non/go-is-svg\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\tsvg \"github.com/h2non/go-is-svg\"\n)\n\nfunc main() {\n\tbuf, err := ioutil.ReadFile(\"_example/example.svg\")\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %s\\n\", err)\n\t\treturn\n\t}\n\n\tif svg.Is(buf) {\n\t\tfmt.Println(\"File is an SVG\")\n\t} else {\n\t\tfmt.Println(\"File is NOT an SVG\")\n\t}\n}\n```\n\nRun example:\n```bash\ngo run _example/example.go\n```\n\n## License\n\nMIT - Tomas Aparicio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2non%2Fgo-is-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh2non%2Fgo-is-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2non%2Fgo-is-svg/lists"}