{"id":21202715,"url":"https://github.com/minoki/luaexif","last_synced_at":"2025-07-10T06:33:17.304Z","repository":{"id":737714,"uuid":"388053","full_name":"minoki/luaexif","owner":"minoki","description":"Lua binding for libexif","archived":false,"fork":false,"pushed_at":"2021-06-10T00:04:01.000Z","size":13,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-19T23:40:56.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minoki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-28T03:28:31.000Z","updated_at":"2021-07-19T10:48:36.000Z","dependencies_parsed_at":"2022-07-18T12:47:58.880Z","dependency_job_id":null,"html_url":"https://github.com/minoki/luaexif","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fluaexif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fluaexif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fluaexif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fluaexif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minoki","download_url":"https://codeload.github.com/minoki/luaexif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225622909,"owners_count":17498182,"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-11-20T20:17:46.844Z","updated_at":"2024-11-20T20:17:48.200Z","avatar_url":"https://github.com/minoki.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"luaexif\n=======\n\nThis is a [Lua](https://www.lua.org/) binding for [libexif](https://libexif.github.io/).\nCompatible with Lua 5.1 or later.\n\nInstall\n=======\n\n```\n$ luarocks make LIBEXIF_DIR=/usr/local\n```\n\nOr, manually with Makefile:\n```\n$ make LUA=/usr/local LIBEXIF=/usr LDFLAGS=-shared\n$ cp exif.so /path/to/module/dir/\n```\n\nManual\n======\nThe `exif` module:\n\n* `exif = require \"exif\"`\n  Loads the module and set it to a variable. Note that the call to `require` does not set a global variable.\n* `exif.new()`\n  Allocates a new `data` and returns it.\n* `exif.loadfile(filename)`\n  Loads the file specified by `filename`. Returns a `data`.\n* `exif.loadbuffer(buffer)`\n  Loads the buffer given by `buffer`. Returns a `data`.\n\nData types:\n\n* `data` --- the entire EXIF data found in an image.\n    * `mnotedata = data.mnotedata`\n      Returns the MakerNote data.\n    * `data:fix()`\n    * `data:loadbuffer(buffer)`\n    * `content = data:ifd(ifd)`\n      `ifd` is one of `\"0\"`,`\"1\"`,`\"EXIF\"`,`\"GPS\"`,`\"Interoperability\"`.\n      Returns an IFD.\n    * `data:ifds()`\n      Returns a integer-indexed table that contains all IFDs.\n* `content` --- all EXIF tags found in a single IFD.\n    * `content:fix()`\n    * `content.ifd`\n      Returns one of `\"0\"`,`\"1\"`,`\"EXIF\"`,`\"GPS\"`,`\"Interoperability\"`.\n    * `entry = content:entry(tag)`\n      Returns an EXIF tag.\n    * `content:entries()`\n      Returns a table that contains all EXIF tags.\n    * `content.parent`\n* `entry` --- one EXIF tag\n    * `entry:fix()`\n    * `entry.tag` Tag name as a string.\n    * `entry.value` Returns a localized textual representation of the value.\n    * `entry.components`\n    * `entry.format` Returns a textual representation of the data type.\n    * `entry.rawdata`\n    * `entry.parent` Returns the content object to which `entry` belongs.\n    * `entry.data` Same as `entry[1]`\n    * `entry[n]` (`n` is an integer between `1` and `entry.components`)\n    * `tostring(entry)` Same as `entry.value`.\n* `mnotedata` --- all data found in MakerNote tag.\n    * `#mnotedata`\n    * `mnotedata[n]`\n      `n` is an integer between `1` and `#mnotedata`.\n* `rational` --- a rational number, possibly returned by `entry.data` or `entry[n]`\n    * `rational.numerator` The numerator as an integer.\n    * `rational.denominator` The denominator as an integer.\n    * `rational.value` The ratio as a Lua number.\n    * `tostring(rational)` Same as `rational.numerator .. \"/\" .. rational.denominator`.\n\nExample\n=======\n```Lua\nlocal exif = require \"exif\"\nlocal data = exif.loadfile(\"mypicture.jpg\") -- Load the EXIF data from \"mypicture.jpg\"\nprint(data:ifd(\"0\"):entry(\"DateTime\")) --\u003e \"2014:10:25 12:55:22\"\nlocal ExposureTime = data:ifd(\"EXIF\"):entry(\"ExposureTime\")\nprint(ExposureTime) --\u003e \"1/125 sec.\"\nprint(ExposureTime.format) --\u003e \"Rational\"\nprint(ExposureTime.data) --\u003e \"1/125\"\nprint(ExposureTime.data.value) --\u003e \"0.008\"\n```\n\nNote that requiring \"exif\" module doesn't set a global variable with the module name.\nYou can assign the module (result of `require`) to a local variable, as in the example above.\n\nLinks\n=====\n\n* [Lua](https://www.lua.org/)\n* [libexif](https://libexif.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Fluaexif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminoki%2Fluaexif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Fluaexif/lists"}