{"id":50862527,"url":"https://github.com/stepbrobd/imgmeta","last_synced_at":"2026-06-14T22:05:14.941Z","repository":{"id":358509414,"uuid":"1241633815","full_name":"stepbrobd/imgmeta","owner":"stepbrobd","description":"pure ocaml image metadata library","archived":false,"fork":false,"pushed_at":"2026-06-13T07:31:47.000Z","size":307,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-13T09:21:22.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/stepbrobd.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-17T16:22:07.000Z","updated_at":"2026-06-13T07:31:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stepbrobd/imgmeta","commit_stats":null,"previous_names":["stepbrobd/imgmeta"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stepbrobd/imgmeta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepbrobd%2Fimgmeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepbrobd%2Fimgmeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepbrobd%2Fimgmeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepbrobd%2Fimgmeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stepbrobd","download_url":"https://codeload.github.com/stepbrobd/imgmeta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepbrobd%2Fimgmeta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34339245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-06-14T22:05:11.777Z","updated_at":"2026-06-14T22:05:14.936Z","avatar_url":"https://github.com/stepbrobd.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imgmeta\n\nBinary Cache:\n\n- Cache: \u003chttps://cache.ysun.co\u003e\n- Key: `cache.ysun.co-1:WxPYwT5g3kt9XhUhHPpNLZKI9HIOsVVAuqSHpok8Qt4=`\n\nMetadata reader for PNG, JPEG, GIF, WebP, HEIF, and AVIF. Reads \"just enough\"\nbytes to extract dimensions, depth, and orientation without decoding the image.\n\nPut this in dune:\n\n```dune\n(libraries imgmeta)\n```\n\nAPI:\n\n```ocaml\nImgmeta.of_file       : string     -\u003e (t, error) result\nImgmeta.of_bytes      : bytes      -\u003e (t, error) result\nImgmeta.of_in_channel : in_channel -\u003e (t, error) result\n```\n\n`*_exn` variants are also exposed and raise `Imgmeta_error` on failure (see\nbelow).\n\n```ocaml\nmatch Imgmeta.of_file \"photo.avif\" with\n| Ok { format; width; height; depth; orientation } -\u003e\n  Printf.printf \"%dx%d (depth=%d, orient=%d)\\n\" width height depth orientation\n| Error e -\u003e Format.eprintf \"%a@.\" Imgmeta.pp_error e\n```\n\nYou get:\n\n```ocaml\ntype t = {\n  format      : format;  (* PNG | JPEG | GIF | WebP | HEIF | AVIF *)\n  width       : int;     (* display width  (post-rotation)        *)\n  height      : int;     (* display height (post-rotation)        *)\n  depth       : int;     (* bits per channel                      *)\n  orientation : int;     (* EXIF 1..8, 1 means no rotation        *)\n}\n```\n\n`width` and `height` are the dimensions a browser will actually render. If the\nimage carries an EXIF `Orientation` tag of 5/6/7/8 (or an HEIF/AVIF `irot` box\nequivalent), the dimensions are swapped from the raw pixel buffer. Use\n`orientation` if you need the original tag.\n\nError type:\n\n```ocaml\ntype error =\n  | Unknown_format\n  | Truncated\n  | Malformed of string\n  | Io_error of string\n```\n\nFormat detection sniffs the first 16 bytes, returns `None` for unrecognized\ninputs:\n\n```ocaml\nImgmeta.detect_format : bytes -\u003e format option\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepbrobd%2Fimgmeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepbrobd%2Fimgmeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepbrobd%2Fimgmeta/lists"}