{"id":19560109,"url":"https://github.com/plotdb/imgtype","last_synced_at":"2026-04-01T19:33:06.221Z","repository":{"id":79658017,"uuid":"236053638","full_name":"plotdb/imgtype","owner":"plotdb","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-20T06:27:38.000Z","size":2546,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T23:02:02.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pug","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plotdb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-24T17:51:59.000Z","updated_at":"2026-03-20T06:27:25.000Z","dependencies_parsed_at":"2025-02-26T08:30:17.927Z","dependency_job_id":"0498ef46-d115-4ff6-a68b-b92f1a173ccc","html_url":"https://github.com/plotdb/imgtype","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/plotdb/imgtype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotdb%2Fimgtype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotdb%2Fimgtype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotdb%2Fimgtype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotdb%2Fimgtype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plotdb","download_url":"https://codeload.github.com/plotdb/imgtype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotdb%2Fimgtype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T05:06:00.045Z","updated_at":"2026-04-01T19:33:06.213Z","avatar_url":"https://github.com/plotdb.png","language":"Pug","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imgtype\n\nImage type Hint.\n\n\n## Usage\n\nrequire! \u003c[imgtype]\u003e # only if use in nodejs\nimgtype(obj).then ({ext, mime}) -\u003e ... # ext = null if can't figure it out\n\n\n## Mime mappaing\n\nYou can use `imgtype.mime[\"...\"]` to get the mime type for a specific file extension, such as:\n\n    imgtype.mime.svg\n    imgtype.mime.jpg\n\n\nSupported extensions include:\n\n - `bmp`: `image/bmp`\n - `gif`: `image/gif`\n - `png`: `image/png`\n - `svg`: `image/svg+xml`\n - `tif`: `image/tiff`\n - `jpg`: `image/jpeg`\n\n\n\n## Approach\n\nImage file type can be detected throught the first two bytes of the file:\n\n * TIF\n   - SU : 49 49\n   - TU : 4D 4D\n * BMP : Qk : 42 4D\n * JPG : /9 : FF D8 FF EO ( Starting 2 Byte will always be same)\n * PNG : iV : 89 50 4E 47\n * GIF : R0 : 47 49 46 38\n * SVG \n   - `\u003c?xml` or `\u003csvg`, with possibly space ahead.\n   - PD : 3C 3F  `\u003c?`\n   - PH : 3C 73  `\u003cs`\n   - ID : 20 3C  ` \u003c`\n   - IC : 20 20  `  `\n\nWhile image files begin with these pattern, there might still be other file formats that begin with the same pattern. Furthermore, there might be exceptions for SVG files.\n\nThus, this should only be considered as a hint instead of a correct result.\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotdb%2Fimgtype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplotdb%2Fimgtype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotdb%2Fimgtype/lists"}