{"id":17136920,"url":"https://github.com/jessestuart/exif-parser","last_synced_at":"2025-04-12T02:04:02.152Z","repository":{"id":38897191,"uuid":"183109671","full_name":"jessestuart/exif-parser","owner":"jessestuart","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-11T23:18:47.000Z","size":1768,"stargazers_count":0,"open_issues_count":36,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:03:54.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jessestuart.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":"2019-04-23T23:20:08.000Z","updated_at":"2024-12-09T06:48:43.000Z","dependencies_parsed_at":"2024-02-01T21:51:07.975Z","dependency_job_id":"10e9955a-38d4-4864-b855-9afc09f9b362","html_url":"https://github.com/jessestuart/exif-parser","commit_stats":{"total_commits":691,"total_committers":17,"mean_commits":40.64705882352941,"dds":"0.22141823444283648","last_synced_commit":"807bd1bdf2848db9b2a0996efe101cf233975af1"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessestuart%2Fexif-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessestuart%2Fexif-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessestuart%2Fexif-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessestuart%2Fexif-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jessestuart","download_url":"https://codeload.github.com/jessestuart/exif-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505863,"owners_count":21115354,"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-10-14T20:05:45.704Z","updated_at":"2025-04-12T02:04:02.122Z","avatar_url":"https://github.com/jessestuart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exif-parser\n\n`exif-parser` is a parser for image metadata in the exif format, the most popular\nmetadata format for jpeg and tiff images. It is written in pure Typescript and\nhas no external dependencies. It can also get the size of jpeg images and the\nsize of the jpeg thumbnail embedded in the exif data. It can also extract the\nembedded thumbnail image.\n\n### Installing\n\n```console\nyarn add @jesses/exif-parser\n```\n\n### Creating a parser\n\nTo start parsing exif data, create a new parser like below. Note that the buffer\nyou pass does not have to be the buffer for the full jpeg file. The exif section\nof a jpeg file has a maximum size of 65535 bytes and the section seems to always\noccur within the first 100 bytes of the file. So it is safe to only fetch the\nfirst 65635 bytes of a jpeg file and pass those to the parser.\n\nThe buffer you pass to create can be a node buffer or a DOM `ArrayBuffer`. Note\nthat the `parse` method throws an Error when the data passed in is not valid\nJPEG data.\n\n```\nvar parser = require('exif-parser').create(buffer);\ntry {\n  var result = parser.parse();\n} catch(err) {\n  // got invalid data, handle error\n}\n```\n\n### Setting the flags\n\nBefore calling parse, you can set a number of flags on the parser, telling it\nhow to behave while parsing.\n\nAdd fields in the binary format to result. Since these fields are mostly used\nfor internal fields like Padding, you generally are not interested in these. If\nenabled, values for these fields will be a Buffer object in node or an\n`ArrayBuffer` in DOM environments (browsers).\n\n    parser.enableBinaryFields([boolean]), default false;\n\nEXIF tags are organized into different sections, and to tell you the offset to\nother sections, EXIF uses certain tags. These tags don't tell you anything about\nthe image, but are more for parsers to find out about all tags. Hence, these\n\"pointer\" fields are not included in the result tags field by default. Change\nthis flag to include them nonetheless.\n\n    parser.enablePointers([boolean]), default false;\n\nResolve tags to their textual name, making `result.tags` a dictionary object\ninstead of an array with the tag objects with no textual tag name.\n\n    parser.enableTagNames([boolean]), default true;\n\nRead the image size while parsing.\n\n    parser.enableImageSize([boolean]), default true;\n\nRead the EXIF tags. Could be useful to disable if you only want to read the\nimage size.\n\n    parser.enableReturnTags([boolean]), default true;\n\nEXIF values can be represented in a number of formats (fractions, degrees,\narrays, ...) with different precision. Enabling this tries to cast values as\nmuch as possible to the appropriate javascript types like number, Date.\n\n    parser.enableSimpleValues([boolean]), default true;\n\n### working with the result\n\n#### Getting the tags\n\nThe tags that were found while parsing are stored in `result.tags` unless you\nset `parser.enableReturnTags(false)`. If `parser.enableTagNames` is set to true,\n`result.tags` will be an object with the key being the tag name and the value\nbeing the tag value. If `parser.enableTagNames` is set to false, `result.tags`\nwill be an array of objects containing section, type and value properties.\n\n#### Getting the image size\n\nIf `parser.enableImageSize` is set to true, `result.getImageSize()` will give\nyou the image size as an object with width and height properties.\n\n#### Getting the thumbnail\n\nYou can check if there is a thumbnail present in the exif data with\n`result.hasThumbnail()`. Exif supports thumbnails is jpeg and tiff format,\nthough most are in jpeg format. You can check if there is a thumbnail present in\na give format by passing the mime type: `result.hasThumbnail(\"image/jpeg\")`.\n\nYou can also get the image size of the thumbnail as an object with width and\nheight properties: `result.getThumbnailSize()`.\n\nTo get the node buffer or `ArrayBuffer` containing just the thumbnail, call\n`result.getThumbnailBuffer()`\n\n# Running the unit tests\n\nInstall `nodeunit` globally from npm if you haven't done so already. You can run\nthe tests with `nodeunit test/test-*.js`.\n\n# Contributions\n\nI welcome external contributions through pull requests. If you do so, please\ndon't use regular expressions. I don't like them, and don't want to maintain a\nproject where they are used. Also, when fixing a bug please provide a regression\nunit test if it makes sense.\n\n[github]: https://github.com/bwindels/exif-parser-browser-bundles\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessestuart%2Fexif-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessestuart%2Fexif-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessestuart%2Fexif-parser/lists"}