hsexif-0.2.0.0: EXIF handling library in pure Haskell

Safe HaskellNone

Graphics.HsExif

Description

Ability to work with the EXIF data contained in JPEG files.

Synopsis

Documentation

data ExifTag Source

An exif tag. Normally you don't need to fiddle with this, except maybe if the library doesn't know the particular exif tag you're interested in. Rather check the list of supported exif tags, like exposureTime and so on.

Constructors

ExifTag 

Fields

tagLocation :: TagLocation

In which part of the JPEG file the exif tag was found

tagDesc :: Maybe String

Description of the exif tag (exposureTime, fnumber...) or if unknown, Nothing. This should be purely for debugging purposes, to compare tags use == on ExifTag or compare the tagKey.

tagKey :: Word16

Exif tag key, the number uniquely identifying this tag.

data TagLocation Source

Location of the tag in the JPG file structure. Normally you don't need to fiddle with this, except maybe if the library doesn't know the particular exif tag you're interested in. Rather check the list of supported exif tags, like exposureTime and so on.

Constructors

ExifSubIFD 
IFD0 

data ExifValue Source

An exif value. Exif values can also be float, but this library doesn't support it yet. If you have JPG files containing float exif values, please send it!

If you want a string describing the contents of the value, simply use show.

Constructors

ExifNumber Int

An exif number. Could be short, int, signed or not.

ExifText String

ASCII text.

ExifRational Int Int

A rational number (numerator, denominator). Sometimes we're used to it as rational (exposition time: 1/160), sometimes as float (exposition compensation, we rather think -0.75) show will display it as 1/160.

ExifUnknown Word16 Int

Unknown exif tag. Not a rarity, we don't support all existing tags.

parseFileExif :: FilePath -> IO (Either String (Map ExifTag ExifValue))Source

Read EXIF data from the file you give. It's a key-value map.

parseExif :: ByteString -> Either String (Map ExifTag ExifValue)Source

Read EXIF data from a lazy bytestring.

getDateTimeOriginal :: Map ExifTag ExifValue -> Maybe LocalTimeSource

Extract the date and time when the picture was taken from the EXIF information.

getOrientation :: Map ExifTag ExifValue -> Maybe ImageOrientationSource

Extract the image orientation from the EXIF information.