{"id":13527510,"url":"https://github.com/exif-js/exif-js","last_synced_at":"2025-05-11T11:01:38.460Z","repository":{"id":655692,"uuid":"298375","full_name":"exif-js/exif-js","owner":"exif-js","description":"JavaScript library for reading EXIF image metadata","archived":false,"fork":false,"pushed_at":"2024-05-31T01:46:13.000Z","size":1314,"stargazers_count":4916,"open_issues_count":187,"forks_count":1279,"subscribers_count":113,"default_branch":"master","last_synced_at":"2025-05-07T12:45:33.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/exif-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2009-09-05T11:54:59.000Z","updated_at":"2025-05-07T10:20:31.000Z","dependencies_parsed_at":"2022-07-05T06:31:12.196Z","dependency_job_id":"d04ff4af-6446-40ef-affe-10f6433ea8d5","html_url":"https://github.com/exif-js/exif-js","commit_stats":{"total_commits":58,"total_committers":24,"mean_commits":"2.4166666666666665","dds":0.7931034482758621,"last_synced_commit":"53b0c7c1951a23d255e37ed0a883462218a71b6f"},"previous_names":["jseidelin/exif-js"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exif-js%2Fexif-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exif-js%2Fexif-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exif-js%2Fexif-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exif-js%2Fexif-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exif-js","download_url":"https://codeload.github.com/exif-js/exif-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253086843,"owners_count":21851820,"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":[],"created_at":"2024-08-01T06:01:49.978Z","updated_at":"2025-05-11T11:01:38.348Z","avatar_url":"https://github.com/exif-js.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Exif.js\n\nA JavaScript library for reading [EXIF meta data](https://en.wikipedia.org/wiki/Exchangeable_image_file_format) from image files.\n\nYou can use it on images in the browser, either from an image or a file input element. Both EXIF and IPTC metadata are retrieved.\nThis package can also be used in AMD or CommonJS environments.\n\n**Note**: The EXIF standard applies only to `.jpg` and `.tiff` images. EXIF logic in this package is based on the EXIF standard v2.2 ([JEITA CP-3451, included in this repo](/spec/Exif2-2.pdf)).\n\n## Install\nInstall `exif-js` through [NPM](https://www.npmjs.com/#getting-started):\n\n    npm install exif-js --save    \n\nOr [Bower](http://bower.io/):\n\n    bower install exif-js --save\n\nThen add a `script` tag in your an HTML in the [best position](http://stackoverflow.com/questions/436411/where-is-the-best-place-to-put-script-tags-in-html-markup) referencing your local file.\n\n```html\n\u003cscript src=\"vendors/exif-js/exif-js\"\u003e\u003c/script\u003e\n```\n\nYou can also use a minified version hosted on jsDelivr\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/exif-js\"\u003e\u003c/script\u003e\n```\n\n## Usage\nThe package adds a global `EXIF` variable (or AMD or CommonJS equivalent).\n\nStart with calling the `EXIF.getData` function. You pass it an image as a parameter:\n- either an image from a `\u003cimg src=\"image.jpg\"\u003e`\n- OR a user selected image in a `\u003cinput type=\"file\"\u003e` element on your page.\n\nAs a second parameter you specify a callback function. In the callback function you should use `this` to access the image with the aforementioned metadata you can then use as you want.\nThat image now has an extra `exifdata` property which is a Javascript object with the EXIF metadata. You can access it's properties to get data like the *image caption*, the *date a photo was taken* or it's *orientation*.\n\nYou can get all tages with `EXIF.getTag`. Or get a single tag with `EXIF.getTag`, where you specify the tag as the second parameter.\nThe tag names to use are listed in `EXIF.Tags` in `exif.js`.\n\n**Important**: Note that you have to wait for the image to be completely loaded, before calling `getData` or any other function. It will silently fail otherwise.\nYou can implement this wait, by running your exif-extracting logic on the `window.onLoad` function. Or on an image's own `onLoad` function.\nFor jQuery users please note that you can NOT (reliably) use jQuery's `ready` event for this. Because it fires before images are loaded.\nYou could use $(window).load() instead of $(document.ready() (please note that `exif-js has NO dependency on jQuery or any other external library). \n \n**JavaScript**:\n```javascript\nwindow.onload=getExif;\n\nfunction getExif() {\n    var img1 = document.getElementById(\"img1\");\n    EXIF.getData(img1, function() {\n        var make = EXIF.getTag(this, \"Make\");\n        var model = EXIF.getTag(this, \"Model\");\n        var makeAndModel = document.getElementById(\"makeAndModel\");\n        makeAndModel.innerHTML = `${make} ${model}`;\n    });\n\n    var img2 = document.getElementById(\"img2\");\n    EXIF.getData(img2, function() {\n        var allMetaData = EXIF.getAllTags(this);\n        var allMetaDataSpan = document.getElementById(\"allMetaDataSpan\");\n        allMetaDataSpan.innerHTML = JSON.stringify(allMetaData, null, \"\\t\");\n    });\n}\n```\n\n**HTML**:\n```html\n\u003cimg src=\"image1.jpg\" id=\"img1\" /\u003e\n\u003cpre\u003eMake and model: \u003cspan id=\"makeAndModel\"\u003e\u003c/span\u003e\u003c/pre\u003e\n\u003cbr/\u003e\n\u003cimg src=\"image2.jpg\" id=\"img2\" /\u003e\n\u003cpre id=\"allMetaDataSpan\"\u003e\u003c/pre\u003e\n\u003cbr/\u003e\n```\n\nNote there are also alternate tags, such the `EXIF.TiffTags`. See the source code for the full definition and use.\nYou can also get back a string with all the EXIF information in the image pretty printed by using `EXIF.pretty`.\nCheck the included [index.html](/exif-js/exif-js/blob/master/index.html).\n\n**XMP**\nSince issue #53 was merged also extracting of XMP data is supported. To not slow down this is optional, and you need to call `EXIF.enableXmp();` before using `EXIF.getData()`.\n\nPlease refer to the [source code](exif.js) for more advanced usages such as getting image data from a [File/Blob](https://developer.mozilla.org/en/docs/Web/API/Blob) object (`EXIF.readFromBinaryFile`).\n\n## Contributions\nThis is an [open source project](LICENSE.md). Please contribute by forking this repo and issueing a pull request. The project has had notable contributions already, like reading ITPC data.\n\nYou can also contribute by [filing bugs or new features please issue](/exif-js/issues).\nOr improve the documentation. Please update this README when you do a pull request of proposed changes in base functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexif-js%2Fexif-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexif-js%2Fexif-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexif-js%2Fexif-js/lists"}