Packages

Read TIFF and EXIF information from a JPEG-format image. iex> {:ok, info} = Exexif.exif_from_jpeg_buffer(buffer) iex> info.x_resolution 72 iex> info.model "DSC-RX100M2" ...> Exexif.Data.Gps.inspect info "41°23´16˝N,2°11´50˝E"

Current section

Files

Jump to
nextexif lib exexif read_error.ex
Raw

lib/exexif/read_error.ex

defmodule Exexif.ReadError do
@moduledoc """
The error raised on any attempt to deal with incorrect files.
"""
defexception [:type, :file, :message]
@impl true
def exception(type: type, file: file) do
msg =
case file do
nil -> "Error reading EXIF data from buffer"
_ -> "Error reading EXIF data from file [#{file}]"
end
%Exexif.ReadError{type: type, file: file, message: msg}
end
end