Functions to extract and interpret image EXIF data.
Summary
Functions
Extract EXIF data from a binary blob.
Returns the libvips header field name for a known EXIF field alias.
Types
@type context() :: {value(), non_neg_integer(), (any() -> non_neg_integer())}
@type t() :: %{ :brightness_value => float(), :color_space => binary(), :component_configuration => binary(), :compressed_bits_per_pixel => non_neg_integer(), :contrast => binary(), :custom_rendered => binary(), :datetime_digitized => binary(), :datetime_original => binary(), :digital_zoom_ratio => non_neg_integer(), :exif_image_height => non_neg_integer(), :exif_image_width => non_neg_integer(), :exif_version => binary(), :exposure_mode => binary(), :exposure_bias_value => non_neg_integer(), :exposure_program => binary(), :exposure_time => binary(), :f_number => non_neg_integer(), :file_source => binary(), :flash => binary(), :flash_pix_version => binary(), :focal_length_in_35mm_film => non_neg_integer(), :focal_length => float(), :iso_speed_ratings => non_neg_integer(), :lens_info => [float()], :light_source => non_neg_integer(), :max_aperture_value => float(), :metering_mode => binary(), :recommended_exposure => non_neg_integer(), :saturation => binary(), :scene_capture_type => binary(), :scene_type => binary(), :sensitivity_type => binary(), :sharpness => binary(), :white_balance => binary(), optional(binary()) => binary() }
@type value() :: binary()
Functions
Extract EXIF data from a binary blob.
Examples
iex> image = Image.open!("./test/support/images/Kip_small.jpg")
iex> {:ok, <<"Exif", 0::16, blob::binary>>} = Vix.Vips.Image.header_value(image, "exif-data")
iex> exif = Image.Exif.extract_exif(blob)
iex> is_map(exif) and is_map_key(exif, :artist) and is_map_key(exif, :make)
true
iex> Image.Exif.extract_exif(<<1, 2, 3>>)
{:error, :invalid_exif}
Returns the libvips header field name for a known EXIF field alias.
Examples
iex> Image.Exif.field(:artist)
"exif-ifd0-Artist"
iex> Image.Exif.field(:copyright)
"exif-ifd0-Copyright"
iex> Image.Exif.field("anything-else")
"anything-else"