hexif-0.2.0.0: Reading Exif data form a JPEG file with Haskell

Safe HaskellSafe-Inferred

Graphics.Hexif

Description

Read and interpret the exif file of a JPEG image with pure Haskell code.

This hexif library has similar functionality as the exif package (http://hackage.haskell.org/package/exif-3000.0.0/docs/Graphics-Exif.html), which calls the C-library libexif(http://libexif.sourceforge.net/).

The first example shows how to print out all supported exif information of a JPEG image.

 processFile :: FilePath -> IO()
 processFile fn = do
     exif <- fromFile fn
     mapM_ print (allFields exif)

Example:

 processFile "RS4748.JPG"

The next example prints out the value of a single tag:

 singleTag :: FilePath -> ExifTag -> IO()
 singleTag fn tag = do
     exif <- fromFile fn
     print $ getTag exif tag

Example:

 singleTag "RS4847.JPG" TagComponentsConfiguration

For more information about JPG and Exif, see

Synopsis

Documentation

data ExifField Source

Definiton of the resulting output

Constructors

ExifField ExifTag String 

data ExifTag Source

Definition of all the supported Exif tags

Constructors

TagInteroperabilityIndex 
TagInteroperabilityVersion 
TagImageWidth 
TagImageLength 
TagBitsPerSample 
TagCompression 
TagPhotometricInterpretation 
TagImageDescription 
TagModel 
TagMake 
TagOrientation 
TagSamplesPerPixel 
TagTagUnknown Word16 
TagXResolution 
TagYResolution 
TagResolutionUnit 
TagSoftware 
TagDateTime 
TagArtist 
TagHostComputer 
TagWhitePoint 
TagPrimaryChromaticities 
TagJPEGInterchangeFormat 
TagJPEGInterchangeFormatLength 
TagYCbCrCoefficients 
TagYCbCrPositioning 
TagReferenceBlackWhite 
TagRelatedImageWidth 
TagRelatedImageLength 
TagCopyright 
TagExposureTime 
TagFNumber 
TagExposureProgram 
TagISOSpeedRatings 
TagSensitivityType 
TagExifVersion 
TagDateTimeOriginal 
TagDateTimeDigitized 
TagComponentsConfiguration 
TagCompressedBitsPerPixel 
TagShutterSpeedValue 
TagApertureValue 
TagBrightnessValue 
TagExposureBiasValue 
TagMaxApertureValue 
TagSubjectDistance 
TagMeteringMode 
TagLightSource 
TagFlash 
TagFocalLength 
TagMakerNote 
TagUserComment 
TagSubsecTime 
TagSubSecTimeOriginal 
TagSubSecTimeDigitized 
TagXPTitle 
TagXPAuthor 
TagFlashPixVersion 
TagColorSpace 
TagPixelXDimension 
TagPixelYDimension 
TagFocalPlaneXResolution 
TagFocalPlaneYResolution 
TagFocalPlaneResolutionUnit 
TagSensingMethod 
TagFileSource 
TagSceneType 
TagCFAPattern 
TagCustomRendered 
TagExposureMode 
TagWhiteBalance 
TagDigitalZoomRatio 
TagFocalLengthIn35mmFilm 
TagSceneCaptureType 
TagGainControl 
TagContrast 
TagSaturation 
TagSharpness 
TagSubjectDistanceRange 
TagImageUniqueID 
TagGamma 
TagPrintImageMatching 
TagPanasonicTitle1 
TagPanasonicTitle2 
TagPadding 
TagOffsetSchemata 
TagGPSVersionID 
TagGPSLatitudeRef 
TagGPSLatitude 
TagGPSLongitudeRef 
TagGPSLongitude 
TagGPSAltitudeRef 
TagGPSAltitude 
TagGPSTimeStamp 
TagGPSImgDirectionRef 
TagGPSImgDirection 
TagGPSMapDatum 
TagGPSDestLatitudeRef 
TagGPSDestLatitude 
TagGPSDestLongitudeRef 
TagGPSDestLongitude 
TagGPSDateStamp 
TagSubDirIFDMain 
TagSubDirIFDExif 
TagSubDirIFDGPS 
TagSubDirIFDInterop 

Instances

allFields :: Exif -> [ExifField]Source

Return a list of all ExifFields (but without debug tags).

getTag :: Exif -> ExifTag -> Maybe StringSource

Return the value of a single Exif tag.

allFieldsInclDebug :: Exif -> [ExifField]Source

Return a list of all ExifFields including the debug tags. Do NOT use this function. It will be deleted later.

fromFile :: FilePath -> IO ExifSource

Return the exit data from a jpeg file. Use this function to initialize your exif value

fromExifFile :: FilePath -> IO ExifSource

Helper function to read exif data from a dumped exif file Do not use this function. It's mainly used for debugging

dumpExif :: FilePath -> IO ()Source

Debugging function: Write the Exif file separatly to disk Do not use this function. It's mainly used for debugging