This library displays the metadata associated with images and does some more.
Image formats embed standardized information about themselves. Multiple information standards may coexist in the same image, for example Exif, IPTC, ICC and XMP. The Exif standard specify a special tag called Makernote that allows camera manufactures to add their proprietary tags.
Over the years, software solutions for retrieving and preserving metadata have coalesced around a handful of flagship projects with Phil Harvey’s Exiftool reigning supreme. For Java, the go-to solution is Drew Noakes’s metadata extractor. This library depends on the latter.
Two namespaces are meant for public consumption, beeld.core
and
beeld.metadata
.
Most users will need only the tags
function, which accepts a filename
and returns a data structure reflecting the metadata associated with
the image. Since images may have large amounts metadata, the data
structure, a map of maps, is organized around standardized
directories. Think about them as thematic groupings of
information. Examples of such headings are Exif SubIFD
, File Type
,
GPS
, etc.
The argument to tags
are the same arguments that input-stream
accepts:
InputStream, File, URI, URL, byte array, strings. A string argument
gets first resolved as a URI, then as a local file name. This means
that you can ask about the metadata of images over the wire.
(require '[beeld.metadata :as meta])
(meta/tags "path/to/your/image.jpg")
;;or
(meta/tags "https://somewhere.com/your/image.jpg")
;; Returns a map of maps
The namespace beeld.metadata
offers several convenience functions that
retrieve a particular metadata tag, for example mime-type
, lens
, make
,
orientation
, etc.
beeld.core
defines an interface geared towards low-level image
manipulation. The namespace includes functions to convert images to
base64, streams or byte arrays, very much in the spirit of Java
I/O. The scale
function in beeld.core will honor the orientation tag
found in the metada and resize the image accordingly. Something that
Java’s ImageIO doesn’t do.
Additional convenience functions in the beeld.metadata
namespace are
welcome. Anything else requires preliminary discussion and vetting.