diff options
Diffstat (limited to 'converter/other/exif.h')
-rw-r--r-- | converter/other/exif.h | 95 |
1 files changed, 60 insertions, 35 deletions
diff --git a/converter/other/exif.h b/converter/other/exif.h index 57eb745b..37dcf240 100644 --- a/converter/other/exif.h +++ b/converter/other/exif.h @@ -10,52 +10,77 @@ #define PATH_MAX _MAX_PATH #endif +typedef struct { /*-------------------------------------------------------------------------- - This structure stores Exif header image elements in a simple manner - Used to store camera data as extracted from the various ways that it can be - stored in an exif header + A structure of this type contains the information from an EXIF header + Image File Directory (IFD). + + It appears that some of these members are possible only for certain kinds of + IFD (e.g. ThumbnailSize does not appear in a legal IFD for a main image), + but we recognize all tags in all IFDs all the same. --------------------------------------------------------------------------*/ + /* In all of the following members, a null pointer means "not present," + which normally means the tag from which the information comes was + not present in the IFD. + + The EXIF format might require certain tags to be present, but we + don't. + */ + const char * cameraMake; + const char * cameraModel; + const char * dateTime; + float * xResolutionP; + float * yResolutionP; + int * orientationP; + int * isColorP; + int * flashP; + float * focalLengthP; + float * exposureTimeP; + unsigned int * shutterSpeedP; /* e.g. 128 for 1/128 second */ + float * apertureFNumberP; + float * distanceP; + float * exposureBiasP; + int * whiteBalanceP; + int * meteringModeP; + int * exposureProgramP; + int * isoEquivalentP; + int * compressionLevelP; + const char * comments; + unsigned int * thumbnailOffsetP; + unsigned int * thumbnailLengthP; + unsigned int * exifImageLengthP; + unsigned int * exifImageWidthP; + double * focalPlaneXResP; + double * focalPlaneUnitsP; + + const unsigned char * thumbnail; /* Pointer at the thumbnail */ + unsigned thumbnailSize; /* Size of thumbnail. */ +} exif_ifd; + + typedef struct { - char CameraMake [32]; - char CameraModel [40]; - char DateTime [20]; - float XResolution; - float YResolution; - int Orientation; - int IsColor; - int FlashUsed; - float FocalLength; - float ExposureTime; - float ApertureFNumber; - float Distance; - int HaveCCDWidth; /* boolean */ - float CCDWidth; - float ExposureBias; - int Whitebalance; - int MeteringMode; - int ExposureProgram; - int ISOequivalent; - int CompressionLevel; - char Comments[MAX_COMMENT]; - - const unsigned char * ThumbnailPointer; /* Pointer at the thumbnail */ - unsigned ThumbnailSize; /* Size of thumbnail. */ - - const char * DatePointer; +/*-------------------------------------------------------------------------- + A structure of this type contains the information from an EXIF header. +--------------------------------------------------------------------------*/ + exif_ifd mainImage; /* aka IFD0 */ + exif_ifd thumbnailImage; /* aka IFD1 */ + float * ccdWidthP; /* NULL means none */ } exif_ImageInfo; /* Prototypes for exif.c functions. */ -void -exif_parse(const unsigned char * const exifSection, +void +exif_parse(const unsigned char * const exifSection, unsigned int const length, - exif_ImageInfo * const imageInfoP, + exif_ImageInfo * const imageInfoP, bool const wantTagTrace, const char ** const errorP); -void -exif_showImageInfo(const exif_ImageInfo * const imageInfoP, - FILE * const fileP); +void +exif_showImageInfo(const exif_ImageInfo * const imageInfoP); + +void +exif_terminateImageInfo(exif_ImageInfo * const imageInfoP); #endif |