I'm using
HsExif to add EXIF fields for templates with:
```
photoContext :: Context a
photoContext =
...
`mappend` exifField "make" make show
`mappend` exifField "model" model show
exifField :: String -> ExifTag -> (ExifValue -> String) -> Context a
exifField key tag print =
field key $ \item -> do
metadata <- exifMetadata item
case M.lookup tag metadata of
Nothing -> noResult ""
Just value -> return $ print value
-- TODO don't load metadata individually for each field
exifMetadata :: Item a -> Compiler (M.Map ExifTag ExifValue)
exifMetadata item = do
let identifier = itemIdentifier item
exifData <- unsafeCompiler (parseFileExif (toFilePath identifier))
return $ fromRight M.empty exifData
```
However, you might notice that the EXIF metadata is parsed for every field.
I've been thinking about how to avoid and can't come up with anything other than some kind of caching, since we only get an `item` which we can parse the metadata from in the lambda of the `field` function which expects a `Compiler String`.