-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to ExifTool -- -- Haskell bindings to the ExifTool command-line application that -- enable reading, writing and deleting metadata in various file formats. @package exiftool @version 0.1.1.0 -- | This module contains bindings to the ExifTool command-line -- application that enable reading, writing and deleting metadata in -- various file formats. Here's a short code example, the details are -- explained below. -- --
-- {-# LANGUAGE OverloadedLists #-}
-- {-# LANGUAGE OverloadedStrings #-}
--
-- import Data.HashMap.Strict ((!?))
-- import ExifTool
--
-- example :: IO ()
-- example =
-- withExifTool $ \et -> do
-- -- Read metadata, with exact (!?) and fuzzy (~~) tag lookup.
-- m <- getMeta et "a.jpg"
-- print $ m !? Tag "EXIF" "ExifIFD" "DateTimeOriginal"
-- print $ m ~~ Tag "EXIF" "" "XResolution"
-- print $ m ~~ Tag "XMP" "" ""
-- -- Write and delete metadata.
-- setMeta et [(Tag "XMP" "XMP-dc" "Description", String "...")] "a.jpg"
-- deleteMeta et [Tag "XMP" "XMP-dc" "Description"] "a.jpg"
--
--
-- Note that this module expects the exiftool binary to be in
-- your PATH.
module ExifTool
-- | An ExifTool instance, initialized with startExifTool and
-- terminated with stopExifTool.
data ExifTool
-- | Start an ExifTool instance. Use stopExifTool when done, or
-- withExifTool to combine both steps.
startExifTool :: IO ExifTool
-- | Stop a running ExifTool instance.
stopExifTool :: ExifTool -> IO ()
-- | Start an ExifTool instance, do something with it, then stop it.
withExifTool :: (ExifTool -> IO a) -> IO a
-- | Read all metadata from a file, with ExifTool errors leading to runtime
-- errors. (Use getMetaEither instead if you would rather
-- intercept them.)
getMeta :: ExifTool -> Text -> IO Metadata
-- | Write metadata to a file, with ExifTool errors leading to runtime
-- errors. (Use setMetaEither instead if you would rather
-- intercept them.) The file is modified in place. Make sure you have the
-- necessary backups!
setMeta :: ExifTool -> Metadata -> Text -> IO ()
-- | Delete metadata from a file, with ExifTool errors leading to runtime
-- errors. (Use deleteMetaEither instead if you would rather
-- intercept them.) The file is modified in place. Make sure you have the
-- necessary backups!
deleteMeta :: ExifTool -> [Tag] -> Text -> IO ()
-- | Read all metadata from a file, with ExifTool errors returned as Left
-- values.
getMetaEither :: ExifTool -> Text -> IO (Either Text Metadata)
-- | Write metadata to a file, with ExifTool errors returned as Left
-- values. The file is modified in place. Make sure you have the
-- necessary backups!
setMetaEither :: ExifTool -> Metadata -> Text -> IO (Either Text ())
-- | Delete metadata from a file, with ExifTool errors returned as Left
-- values. The file is modified in place. Make sure you have the
-- necessary backups!
deleteMetaEither :: ExifTool -> [Tag] -> Text -> IO (Either Text ())
-- | A set of ExifTool tag/value pairs.
type Metadata = HashMap Tag Value
-- | An ExifTool tag name, consisting of three components:
--
--