Mercurial > geeqie
diff src/format_canon.c @ 51:276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
* exif.[ch]: Use glib provided data types and byte order functions for
consistency with rest of application. Made several more functions
available in the header. Use MakerNote parsing from format_raw.c.
* format_canon.[ch]: Changes to match exif.h and format_raw.h.
* format_fuji.[ch]: Add support for Fuji EXIF MakerNote.
* format_nikon.[ch]: New files, add support for Nikon EXIF MakerNote.
* format_raw.[ch]: Add EXIF MakerNote parser functions to gather all
camera formats here (similar to existing raw format list).
* src/Makefile.am: Add format_nikon.[ch].
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
##### an offical release when making enhancements and translation updates. #####
| author | gqview |
|---|---|
| date | Sun, 05 Jun 2005 02:48:54 +0000 |
| parents | 3b83fb81afc4 |
| children | 00843150f7c8 |
line wrap: on
line diff
--- a/src/format_canon.c Sat Jun 04 08:06:47 2005 +0000 +++ b/src/format_canon.c Sun Jun 05 02:48:54 2005 +0000 @@ -251,8 +251,8 @@ } -gint format_raw_test_canon(const void *data, const guint len, - guint *image_offset, guint *exif_offset) +gint format_canon_raw(const void *data, const guint len, + guint *image_offset, guint *exif_offset) { @@ -478,13 +478,6 @@ *----------------------------------------------------------------------------- */ -typedef struct _CanonTag CanonTag; -struct _CanonTag { - guint id; - const gchar *description; - ExifTextList *list; -}; - static ExifTextList CanonSet1MacroMode[] = { { 1, "macro" }, { 2, "normal" }, @@ -728,21 +721,27 @@ EXIF_TEXT_LIST_END }; -static CanonTag CanonCustom[] = { - { 1, "Noise reduction", CanonCustomEnable }, -/* { 2, "Shutter/Auto Exposure Button Function", CanonCustomBTNShutter }, */ - { 3, "Mirror lockup", CanonCustomEnable }, - { 4, "Tv/Av and exposure level", CanonCustomExposureLevel }, - { 5, "AF assist light", CanonCustomEnableInvert }, - { 6, "Shutter speed in Av mode", CanonCustomAVShutterSpeed }, -/* { 7, "Auto-Exposure bracketting sequence/auto cancellation", CanonCustom }, */ - { 8, "Shutter sync", CanonCustomShutterCurtainSync }, -/* { 9, "AF button function", CanonCustom }, */ - { 10, "Fill flash auto reduction", CanonCustomEnableInvert }, -/* { 11, "Menu button function", CanonCustom }, */ -/* { 12, "Set button function", CanonCustom }, */ - { 13, "Sensor cleaning", CanonCustomEnable }, - { 0, NULL, NULL } +static ExifMarker CanonCustom[] = { +{ 1, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.NoiseReduction", "Noise reduction", CanonCustomEnable }, +/*{ 2, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncShutter", + "Shutter/Auto exposure button function",CanonCustomBTNShutter }, */ +{ 3, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.MirrorLockup", "Mirror lockup", CanonCustomEnable }, +{ 4, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.TvAvExposureLevel", + "Tv/Av and exposure level", CanonCustomExposureLevel }, +{ 5, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AFAssistLight", "AF assist light", CanonCustomEnableInvert }, +{ 6, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AvShutterSpeed", + "Shutter speed in Av mode", CanonCustomAVShutterSpeed }, +/*{ 7, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AutoBracket", + "Auto-Exposure bracketting sequence/auto cancellation", CanonCustom }, */ +{ 8, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ShutterSync", "Shutter sync", CanonCustomShutterCurtainSync }, +/* { 9, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncAF", "AF button function", CanonCustom }, */ +{ 10, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FillFlashReduction", + "Fill flash auto reduction", CanonCustomEnableInvert }, +/*{ 11, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncMenu", + "Menu button function", CanonCustom }, */ +/*{ 12, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncSet", "Set button function", CanonCustom }, */ +{ 13, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.SensorCleaning", "Sensor cleaning", CanonCustomEnable }, +EXIF_MARKER_LIST_END }; #endif @@ -760,7 +759,7 @@ }; static void canon_mknote_parse_settings(ExifData *exif, - guint16 *data, guint32 len, int byte_order, + guint16 *data, guint32 len, ExifByteOrder byte_order, ExifMarker *list) { gint i; @@ -825,19 +824,12 @@ } #endif -gint format_exif_makernote_canon_parse(ExifData *exif, unsigned char *tiff, int offset, - int size, int byte_order) +gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset, + guint size, ExifByteOrder byte_order) { ExifItem *item; - gchar *text; - gint found; - text = exif_get_data_as_text(exif, "Make"); - found = (text && strncasecmp(text, "Canon", 5) == 0); - g_free(text); - - if (!found || - exif_parse_IFD_table(exif, tiff, offset, size, byte_order, CanonExifMarkersList) != 0) + if (exif_parse_IFD_table(exif, tiff, offset, size, byte_order, CanonExifMarkersList) != 0) { return FALSE; }
