All Projects → tonytonyjan → exif

tonytonyjan / exif

Licence: MIT license
The fastest Ruby EXIF reader.

Programming Languages

c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to exif

Jpeg Autorotate
Node module to rotate JPEG images based on EXIF orientation.
Stars: ✭ 127 (-4.51%)
Mutual labels:  exif
Pel
PHP Exif Library - library for reading and writing Exif headers in JPEG and TIFF files using PHP.
Stars: ✭ 232 (+74.44%)
Mutual labels:  exif
iptcinfo3
iptcinfo working for python 3 finally do pip3 install iptcinfo3
Stars: ✭ 37 (-72.18%)
Mutual labels:  exif
Metadata Extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 1,972 (+1382.71%)
Mutual labels:  exif
Exiftool Vendored.js
Fast, cross-platform Node.js access to ExifTool
Stars: ✭ 200 (+50.38%)
Mutual labels:  exif
TinyEXIF
Tiny ISO-compliant C++ EXIF and XMP parsing library for JPEG.
Stars: ✭ 87 (-34.59%)
Mutual labels:  exif
Damselfly
Damselfly is a server-based Digital Asset Management system for photographs. The goal of Damselfly is to index an extremely large collection of images, and allow easy search and retrieval of those images, using metadata such as the IPTC keyword tags, as well as the folder and file names.
Stars: ✭ 86 (-35.34%)
Mutual labels:  exif
exiftool-json-db
Maintain a JSON database of photos and videos with their metadata
Stars: ✭ 18 (-86.47%)
Mutual labels:  exif
Forensic Tools
A collection of tools for forensic analysis
Stars: ✭ 204 (+53.38%)
Mutual labels:  exif
tyf
Manipulate EXIF and IFD metadata.
Stars: ✭ 16 (-87.97%)
Mutual labels:  exif
Mmalsharp
C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
Stars: ✭ 152 (+14.29%)
Mutual labels:  exif
Go Exif
A very complete, highly tested, standards-driven (but customizable) EXIF reader/writer lovingly written in Go.
Stars: ✭ 186 (+39.85%)
Mutual labels:  exif
rexiv2
Rust library for read/write access to media-file metadata (Exif, XMP, and IPTC)
Stars: ✭ 64 (-51.88%)
Mutual labels:  exif
Magick.net
The .NET library for ImageMagick
Stars: ✭ 2,071 (+1457.14%)
Mutual labels:  exif
facebook-data-image-exif
UI tool to add EXIF data back to images in a Facebook data export
Stars: ✭ 39 (-70.68%)
Mutual labels:  exif
Gify
JavaScript API for decoding/parsing information from animated GIFs using ArrayBuffers.
Stars: ✭ 124 (-6.77%)
Mutual labels:  exif
exiflibrary
A .Net Standard library for editing Exif metadata
Stars: ✭ 104 (-21.8%)
Mutual labels:  exif
wa-sticker-formatter
Sticker Creator for WhatsApp
Stars: ✭ 60 (-54.89%)
Mutual labels:  exif
naturtag
Tag your nature photos with iNat taxonomy and observation metadata
Stars: ✭ 20 (-84.96%)
Mutual labels:  exif
slack-metabot
Extract metadata (EXIF) from uploaded files on Slack
Stars: ✭ 15 (-88.72%)
Mutual labels:  exif

A Ruby EXIF reader written in C. Build Status

Installation

$ gem install exif

Please make sure you have installed libexif:

$ brew install libexif             # Homebrew
$ sudo apt-get install libexif-dev # APT
$ sudo yum install libexif-devel   # CentOS

Usage

data = Exif::Data.new(IO.read('sample.jpg'))   # load from string
data = Exif::Data.new("Exif\x00\x00II...")     # load raw exif data
data = Exif::Data.new(File.open('sample.jpg')) # load from file
data.model         # => "NIKON D600"
data.image_width   # => 4000
data.gps_longitude # => [(121/1), (76869/2500), (0/1)]
data.date_time     # => "2013:12:08 21:14:11"

# get all entries in an IFD
data[:ifd0]             # => {image_width: 4000, image_length: 2670, ...}
data[:ifd1]             # => {x_resolution: (72/1), y_resolution: (72/1), ...}
data[:exif]             # => exposure_time: (1/125), fnumber: (8/1)}
data[:gps]              # => {gps_version_id: [2, 2, 0, 0], gps_latitude_ref: "N", ...}
data[:interoperability] # => {...}
data.to_h               # => {:ifd0 => {...}, :ifd1 => {...}, :exif => {...}}
data.ifds == data.to_h  # => true

ifd0 takes precedence over ifd1, since ifd0 and ifd1 share the same domain of tags, sometimes the same tag can be both used inside them, in this case, calling top-level API like Exif::Data#image_width will return the value of ifd0.

Typecasting

Tag Type Ruby Class
ASCII String
BYTE Integer
DOUBLE Flat
FLOAT Float
LONG Integer
RATIONAL Rational
SHORT Integer
UNDEFINED String

How fast?

It's hundreds of times faster than mini_exiftool or exiftool and several times faster than exifr.

There are similar excellent gems like exifr, mini_exiftool and exiftool built in pure Ruby while this one is a C extension.

If you are using JRuby you might want to give exifr, exiftool or mini_exiftool a look, the latter two are commandline wrappers for ExifTool by Phil Harvey and support many file formats. The exiftool gem can process multiple files at once while mini_exiftool can modify or copy EXIF data.

Benchmark

You can find all benchmark files in /benchmark:

Read a single tag from 100 files.

$ ruby benchmark/load_file.rb
Rehearsal ---------------------------------------------------------
mini_exiftool (2.9.0)   0.240000   0.110000  22.830000 ( 23.275885)
exiftool (1.2.0)        0.480000   0.130000  22.870000 ( 23.311755)
exifr (1.3.2)           0.120000   0.010000   0.130000 (  0.139821)
exif (49b6835)          0.020000   0.000000   0.020000 (  0.019927)
----------------------------------------------- total: 45.850000sec

                            user     system      total        real
mini_exiftool (2.9.0)   0.240000   0.120000  22.830000 ( 23.267355)
exiftool (1.2.0)        0.490000   0.130000  23.190000 ( 23.678799)
exifr (1.3.2)           0.120000   0.010000   0.130000 (  0.134572)
exif (49b6835)          0.020000   0.000000   0.020000 (  0.018419)
-----------------------------------------
1263 times faster than mini_exiftool (2.9.0)
1286 times faster than exiftool (1.2.0)
7 times faster than exifr (1.3.2)

Read many tags from the same file 1000 times.

$ ruby benchmark/read_tag.rb
Rehearsal ---------------------------------------------------------
mini_exiftool (2.9.0)   0.390000   0.000000   0.390000 (  0.404067)
exiftool (1.2.0)        0.030000   0.000000   0.030000 (  0.027073)
exifr (1.3.2)           1.220000   0.020000   1.240000 (  1.268672)
exif (49b6835)          0.010000   0.000000   0.010000 (  0.006862)
------------------------------------------------ total: 1.670000sec

                            user     system      total        real
mini_exiftool (2.9.0)   0.410000   0.010000   0.420000 (  0.412627)
exiftool (1.2.0)        0.030000   0.000000   0.030000 (  0.028518)
exifr (1.3.2)           1.180000   0.010000   1.190000 (  1.203806)
exif (49b6835)          0.010000   0.000000   0.010000 (  0.006925)
-----------------------------------------
60 times faster than mini_exiftool (2.9.0)
4 times faster than exiftool (1.2.0)
174 times faster than exifr (1.3.2)

Contribution

Tag Reference

  • aperture_value
  • artist
  • battery_level
  • bits_per_sample
  • body_serial_number
  • brightness_value
  • camera_owner_name
  • cfa_pattern
  • cfa_repeat_pattern_dim
  • color_space
  • components_configuration
  • composite_image
  • compressed_bits_per_pixel
  • compression
  • contrast
  • copyright
  • custom_rendered
  • date_time
  • date_time_digitized
  • date_time_original
  • device_setting_description
  • digital_zoom_ratio
  • document_name
  • exif_ifd_pointer
  • exif_version
  • exposure_bias_value
  • exposure_index
  • exposure_mode
  • exposure_program
  • exposure_time
  • file_source
  • fill_order
  • flash
  • flash_energy
  • flash_pix_version
  • fnumber
  • focal_length
  • focal_length_in_35mm_film
  • focal_plane_resolution_unit
  • focal_plane_x_resolution
  • focal_plane_y_resolution
  • gain_control
  • gamma
  • gps_altitude
  • gps_altitude_ref
  • gps_area_information
  • gps_date_stamp
  • gps_dest_bearing
  • gps_dest_bearing_ref
  • gps_dest_distance
  • gps_dest_distance_ref
  • gps_dest_latitude
  • gps_dest_latitude_ref
  • gps_dest_longitude
  • gps_dest_longitude_ref
  • gps_differential
  • gps_dop
  • gps_h_positioning_error
  • gps_img_direction
  • gps_img_direction_ref
  • gps_info_ifd_pointer
  • gps_latitude
  • gps_latitude_ref
  • gps_longitude
  • gps_longitude_ref
  • gps_map_datum
  • gps_measure_mode
  • gps_processing_method
  • gps_satellites
  • gps_speed
  • gps_speed_ref
  • gps_status
  • gps_time_stamp
  • gps_track
  • gps_track_ref
  • gps_version_id
  • image_depth
  • image_description
  • image_length
  • image_resources
  • image_unique_id
  • image_width
  • inter_color_profile
  • interoperability_ifd_pointer
  • interoperability_index
  • interoperability_version
  • iptc_naa
  • iso_speed
  • iso_speed_ratings
  • iso_speedlatitudeyyy
  • iso_speedlatitudezzz
  • jpeg_interchange_format
  • jpeg_interchange_format_length
  • jpeg_proc
  • lens_make
  • lens_model
  • lens_serial_number
  • lens_specification
  • light_source
  • make
  • maker_note
  • max_aperture_value
  • metering_mode
  • model
  • new_cfa_pattern
  • new_subfile_type
  • oecf
  • offset_time
  • offset_time_digitized
  • offset_time_original
  • orientation
  • padding
  • photometric_interpretation
  • pixel_x_dimension
  • pixel_y_dimension
  • planar_configuration
  • primary_chromaticities
  • print_image_matching
  • recommended_exposure_index
  • reference_black_white
  • related_image_file_format
  • related_image_length
  • related_image_width
  • related_sound_file
  • resolution_unit
  • rows_per_strip
  • samples_per_pixel
  • saturation
  • scene_capture_type
  • scene_type
  • sensing_method
  • sensitivity_type
  • sharpness
  • shutter_speed_value
  • software
  • source_exposure_times_of_composite_image
  • source_image_number_of_composite_image
  • spatial_frequency_response
  • spectral_sensitivity
  • standard_output_sensitivity
  • strip_byte_counts
  • strip_offsets
  • sub_ifds
  • sub_sec_time
  • sub_sec_time_digitized
  • sub_sec_time_original
  • subject_area
  • subject_distance
  • subject_distance_range
  • subject_location
  • tiff_ep_standard_id
  • time_zone_offset
  • transfer_function
  • transfer_range
  • user_comment
  • white_balance
  • white_point
  • x_resolution
  • xml_packet
  • xp_author
  • xp_comment
  • xp_keywords
  • xp_subject
  • xp_title
  • y_resolution
  • ycbcr_coefficients
  • ycbcr_positioning
  • ycbcr_sub_sampling

TODO

  1. Create, update and delete tags.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].