{"id":16179717,"url":"https://github.com/bep/imagemeta","last_synced_at":"2025-03-19T01:31:06.238Z","repository":{"id":186929405,"uuid":"676005312","full_name":"bep/imagemeta","owner":"bep","description":"Go library for reading EXIF, IPTC and XMP image meta data from JPEG, TIFF, PNG, and WebP files.","archived":false,"fork":false,"pushed_at":"2025-03-14T09:00:43.000Z","size":13490,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-14T09:28:19.416Z","etag":null,"topics":["exif","image-processing","iptc","xmp"],"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/bep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["bep"]}},"created_at":"2023-08-08T08:09:01.000Z","updated_at":"2025-03-14T08:33:47.000Z","dependencies_parsed_at":"2023-08-08T09:42:00.930Z","dependency_job_id":"6f11e60b-477c-42c9-8953-1606dc6c413f","html_url":"https://github.com/bep/imagemeta","commit_stats":null,"previous_names":["bep/goexif"],"tags_count":20,"template":false,"template_full_name":"bep/golibtemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fimagemeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fimagemeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fimagemeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fimagemeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bep","download_url":"https://codeload.github.com/bep/imagemeta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960361,"owners_count":20375102,"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":["exif","image-processing","iptc","xmp"],"created_at":"2024-10-10T05:43:51.616Z","updated_at":"2025-03-19T01:31:05.125Z","avatar_url":"https://github.com/bep.png","language":"Go","funding_links":["https://github.com/sponsors/bep"],"categories":[],"sub_categories":[],"readme":"[![Tests on Linux, MacOS and Windows](https://github.com/bep/imagemeta/workflows/Test/badge.svg)](https://github.com/bep/imagemeta/actions?query=workflow:Test)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bep/imagemeta)](https://goreportcard.com/report/github.com/bep/imagemeta)\n[![codecov](https://codecov.io/gh/bep/imagemeta/branch/main/graph/badge.svg)](https://codecov.io/gh/bep/imagemeta)\n[![GoDoc](https://godoc.org/github.com/bep/imagemeta?status.svg)](https://godoc.org/github.com/bep/imagemeta)\n\n## This is about READING image metadata\n\nWriting is not supported, and never will.\n\nI welcome PRs with fixes, but please raise an issue first if you want to add new features.\n\n## Performance\n\nExtracting `EXIF` performs well, ref. the benhcmark below. Note that you can get a significant boost if you only need a subset of the fields (e.g. only the `Orientation`). The last line is with the library that [Hugo](https://github.com/gohugoio/hugo) used before it was replaced with this.\n\n```bash\nBenchmarkDecodeCompareWithGoexif/bep/imagemeta/exif/jpeg/alltags-10                62474             19054 ns/op            4218 B/op        188 allocs/op\nBenchmarkDecodeCompareWithGoexif/bep/imagemeta/exif/jpeg/orientation-10           309145              3723 ns/op             352 B/op          8 allocs/op\nBenchmarkDecodeCompareWithGoexif/rwcarlsen/goexif/exif/jpg/alltags-10              21987             50195 ns/op          175548 B/op        812 allocs/op\n```\n\nLooking at some more extensive tests, testing different image formats and tag sources, we see that the current XMP implementation leaves a lot to be desired (you can provide your own XMP handler if you want). \n\n```bash\nBenchmarkDecode/png/exif-10                39164             30783 ns/op            4231 B/op        189 allocs/op\nBenchmarkDecode/png/all-10                  5617            206111 ns/op           48611 B/op        310 allocs/op\nBenchmarkDecode/webp/all-10                 3069            379637 ns/op          144181 B/op       2450 allocs/op\nBenchmarkDecode/webp/xmp-10                 3291            359133 ns/op          139991 B/op       2265 allocs/op\nBenchmarkDecode/webp/exif-10               47028             25788 ns/op            4255 B/op        191 allocs/op\nBenchmarkDecode/jpg/exif-10                58701             20216 ns/op            4223 B/op        188 allocs/op\nBenchmarkDecode/jpg/iptc-10               135777              8725 ns/op            1562 B/op         80 allocs/op\nBenchmarkDecode/jpg/iptc/category-10      215674              5393 ns/op             456 B/op         15 allocs/op\nBenchmarkDecode/jpg/iptc/city-10          192067              6201 ns/op             553 B/op         17 allocs/op\nBenchmarkDecode/jpg/xmp-10                  3244            359436 ns/op          139861 B/op       2263 allocs/op\nBenchmarkDecode/jpg/all-10                  2874            389489 ns/op          145700 B/op       2523 allocs/op\nBenchmarkDecode/tiff/exif-10                2065            566786 ns/op          214089 B/op        282 allocs/op\nBenchmarkDecode/tiff/iptc-10               16761             71003 ns/op            2603 B/op        133 allocs/op\nBenchmarkDecode/tiff/all-10                 1267            933321 ns/op          356878 B/op       2668 allocs/op\n```\n\n## When in doubt, Exiftool is right\n\nThe output of this library is tested against `exiftool -n -json`. This means, for example, that:\n\n*  We use f-numbers and not APEX for aperture values.\n*  We use seconds and not APEX for shutter speed values.\n*  EXIF field definitions are fetched from this table:  https://exiftool.org/TagNames/EXIF.html\n*  IPTC field definitions are fetched from this table:  https://exiftool.org/TagNames/IPTC.html\n*  The XMP handling is currently very simple, you can supply your own XMP handler (see the `HandleXMP` option) if you need more.\n\nThere are some subtle differences in output:\n\n* Exiftool prints rationale number arrays as space formatted strings with a format/precision that seems unnecessary hard to replicate, so we use `strconv.FormatFloat(f, 'f', -1, 64)` for these.\n\n## Development\n\nMany of the tests depends on generated golden files. To update these, run:\n\n```bash\n go generate ./gen\n```\n\nNote that you need a working `exiftool` and updated binary in your `PATH` for this to work. This was tested OK with:\n\n```\nexiftool -ver\n12.76\n```\n\nDebuggin tips:\n\n```bash\n exiftool testdata/goexif_samples/has-lens-info.jpg -htmldump \u003e dump.html\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Fimagemeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbep%2Fimagemeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Fimagemeta/lists"}