{"id":15957090,"url":"https://github.com/mamantoha/crystal-exif","last_synced_at":"2025-04-04T09:29:41.857Z","repository":{"id":39969001,"uuid":"484358443","full_name":"mamantoha/crystal-exif","owner":"mamantoha","description":"Crystal bindings for libexif","archived":false,"fork":false,"pushed_at":"2022-09-19T08:30:35.000Z","size":367,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-09T20:16:26.207Z","etag":null,"topics":["bindings","crystal","exif","libexif"],"latest_commit_sha":null,"homepage":"https://mamantoha.github.io/crystal-exif/","language":"Crystal","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/mamantoha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-22T08:37:53.000Z","updated_at":"2022-11-19T14:46:09.000Z","dependencies_parsed_at":"2022-09-19T15:10:40.846Z","dependency_job_id":null,"html_url":"https://github.com/mamantoha/crystal-exif","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-exif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-exif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-exif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-exif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mamantoha","download_url":"https://codeload.github.com/mamantoha/crystal-exif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247152376,"owners_count":20892478,"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":["bindings","crystal","exif","libexif"],"created_at":"2024-10-07T13:40:31.875Z","updated_at":"2025-04-04T09:29:41.821Z","avatar_url":"https://github.com/mamantoha.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exif\n\n[![Crystal CI](https://github.com/mamantoha/crystal-exif/actions/workflows/crystal.yml/badge.svg)](https://github.com/mamantoha/crystal-exif/actions/workflows/crystal.yml)\n[![GitHub release](https://img.shields.io/github/release/mamantoha/crystal-exif.svg)](https://github.com/mamantoha/crystal-exif/releases)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://mamantoha.github.io/crystal-exif/)\n[![License](https://img.shields.io/github/license/mamantoha/crystal-exif.svg)](https://github.com/mamantoha/crystal-exif/blob/master/LICENSE)\n\nCrystal C bindings for libexif.\n\nProvides basic support for reading EXIF tags on files using libexif and Crystal.\n\n## Installation\n\nGet libexif for your OS:\n\n```\n# MacOS\nbrew install libexif\n\n# Debian/Ubuntu\napt-get install -y libexif-dev\n\n# RedHat/Fedora\ndnf install -y libexif-devel\n```\n\nAdd the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n  exif:\n    github: mamantoha/crystal-exif\n```\n\nRun `shards install`\n\n## Usage\n\nThis is an example on how to read EXIF data from a file:\n\n```crystal\nrequire \"exif\"\n```\n\n![metadata_test.jpg](https://raw.githubusercontent.com/mamantoha/crystal-exif/main/spec/fixtures/metadata_test.jpg)\n\nThe image is taken from [exif-samples](https://github.com/ianare/exif-samples) repository.\n\n### Load EXIF data from a JPEG file\n\n```crystal\nfile = File.open(\"metadata_test.jpg\")\nexif = Exif.new(file)\nexif.data\n```\n\n```crystal\n{\"compression\" =\u003e \"JPEG compression\",\n \"image_description\" =\u003e \"\",\n \"make\" =\u003e \"NIKON\",\n \"model\" =\u003e \"COOLPIX P6000\",\n \"orientation\" =\u003e \"Top-left\",\n \"x_resolution\" =\u003e \"300\",\n \"y_resolution\" =\u003e \"300\",\n \"resolution_unit\" =\u003e \"Inch\",\n \"software\" =\u003e \"Nikon Transfer 1.1 W\",\n \"date_time\" =\u003e \"2008:11:01 21:15:07\",\n \"ycbcr_positioning\" =\u003e \"Centered\",\n \"exposure_time\" =\u003e \"1/75 sec.\",\n \"fnumber\" =\u003e \"f/5.9\",\n \"exposure_program\" =\u003e \"Normal program\",\n \"iso_speed_ratings\" =\u003e \"64\",\n \"exif_version\" =\u003e \"Exif Version 2.2\",\n \"date_time_original\" =\u003e \"2008:10:22 16:28:39\",\n \"date_time_digitized\" =\u003e \"2008:10:22 16:28:39\",\n \"components_configuration\" =\u003e \"Y Cb Cr -\",\n \"exposure_bias_value\" =\u003e \"0.00 EV\",\n \"max_aperture_value\" =\u003e \"2.90 EV (f/2.7)\",\n \"metering_mode\" =\u003e \"Pattern\",\n \"light_source\" =\u003e \"Unknown\",\n \"flash\" =\u003e \"Flash did not fire, compulsory flash mode\",\n \"focal_length\" =\u003e \"24.0 mm\",\n \"maker_note\" =\u003e \"3298 bytes undefined data\",\n \"user_comment\" =\u003e \"\",\n \"flash_pix_version\" =\u003e \"FlashPix Version 1.0\",\n \"color_space\" =\u003e \"sRGB\",\n \"pixel_x_dimension\" =\u003e \"640\",\n \"pixel_y_dimension\" =\u003e \"480\",\n \"file_source\" =\u003e \"DSC\",\n \"scene_type\" =\u003e \"Directly photographed\",\n \"custom_rendered\" =\u003e \"Normal process\",\n \"exposure_mode\" =\u003e \"Auto exposure\",\n \"white_balance\" =\u003e \"Auto white balance\",\n \"digital_zoom_ratio\" =\u003e \"0.00\",\n \"focal_length_in35_mm_film\" =\u003e \"112\",\n \"scene_capture_type\" =\u003e \"Standard\",\n \"gain_control\" =\u003e \"Normal\",\n \"contrast\" =\u003e \"Normal\",\n \"saturation\" =\u003e \"Normal\",\n \"sharpness\" =\u003e \"Normal\",\n \"subject_distance_range\" =\u003e \"Unknown\",\n \"gps_latitude_ref\" =\u003e \"N\",\n \"gps_latitude\" =\u003e \"43, 28, 2.81400000\",\n \"gps_longitude_ref\" =\u003e \"E\",\n \"gps_longitude\" =\u003e \"11, 53, 6.45599999\",\n \"gp_altitude_ref\" =\u003e \"Sea level\",\n \"gps_time_stamp\" =\u003e \"14:27:07.24\",\n \"gps_satellites\" =\u003e \"06\",\n \"gps_img_direction_ref\" =\u003e \"\",\n \"gps_map_datum\" =\u003e \"WGS-84\",\n \"gps_date_stamp\" =\u003e \"2008:10:23\"}\n```\n\n### Return an Exif entry for the given tag\n\n```crystal\nfile = File.open(\"metadata_test.jpg\")\nexif = Exif.new(file)\nexif.make # =\u003e \"NIKON\"\nexif.model # =\u003e \"COOLPIX P6000\"\n```\n\n### Return the MakerNote data out of the EXIF data\n\n```crystal\nfile = File.open(\"metadata_test.jpg\")\nexif = Exif.new(file)\nexif.mnote_data\n```\n\n```crystal\n{\"Firmware\" =\u003e \"0210\",\n \"ISO\" =\u003e \"ISO 0\",\n \"ColorMode1\" =\u003e \"COLOR\",\n \"Quality\" =\u003e \"FINE\",\n \"WhiteBalance\" =\u003e \"AUTO\",\n \"Sharpening\" =\u003e \"NORMAL\",\n \"FocusMode\" =\u003e \"AF-S\",\n \"FlashSetting\" =\u003e \"\",\n \"ISOSelection\" =\u003e \"AUTO\",\n \"FaceDetect\" =\u003e \"8 bytes unknown data: 01004001f0000000\",\n \"ActiveDLighting\" =\u003e \"0\",\n \"ImageAdjustment\" =\u003e \"NORMAL\",\n \"ToneCompensation\" =\u003e \"NORMAL\",\n \"Adapter\" =\u003e \"OFF\",\n \"DigitalZoom\" =\u003e \"1.000\",\n \"AFFocusPosition\" =\u003e \"AF position: center\",\n \"ShotInfo\" =\u003e \"18 bytes unknown data: 000000000e00000000000000000044430000\",\n \"Saturation\" =\u003e \"0\",\n \"NoiseReduction,\" =\u003e \"OFF\",\n \"RetouchHistory\" =\u003e \"Invalid number of components (6, expected 1).\",\n \"Saturation2\" =\u003e \"NORMAL\",\n \"CaptureEditorVer\" =\u003e \"COOLPIX P6000V1.0\"}\n```\n\n## Development\n\n```\ncrystal ./lib/crystal_lib/src/main.cr src/exif/lib_exif.cr.in \u003e src/exif/lib_exif.cr\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/mamantoha/crystal-exif/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-exif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamantoha%2Fcrystal-exif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-exif/lists"}