[Rawstudio-commit] r3036 - branches/rawstudio-ng-color/plugins/meta-tiff
Anders Kvist
anders at kvistmail.dk
Tue Jan 19 18:43:16 CET 2010
Author: akv
Date: 2010-01-19 18:43:08 +0100 (Tue, 19 Jan 2010)
New Revision: 3036
Modified:
branches/rawstudio-ng-color/plugins/meta-tiff/tiff-meta.c
Log:
Reading basic lens information from Olympus cameras.
Modified: branches/rawstudio-ng-color/plugins/meta-tiff/tiff-meta.c
===================================================================
--- branches/rawstudio-ng-color/plugins/meta-tiff/tiff-meta.c 2010-01-18 23:25:24 UTC (rev 3035)
+++ branches/rawstudio-ng-color/plugins/meta-tiff/tiff-meta.c 2010-01-19 17:43:08 UTC (rev 3036)
@@ -59,6 +59,7 @@
static gboolean makernote_olympus(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta);
static gboolean makernote_olympus_camerasettings(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta);
static gboolean makernote_olympus_imageprocessing(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta);
+static gboolean makernote_olympus_equipment(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta);
static gboolean makernote_panasonic(RAWFILE *rawfile, guint offset, RSMetadata *meta);
static gboolean makernote_pentax(RAWFILE *rawfile, guint offset, RSMetadata *meta);
static void sony_decrypt(SonyMeta *sony, guint *data, gint len);
@@ -798,6 +799,47 @@
}
static gboolean
+makernote_olympus_equipment(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta)
+{
+ gushort number_of_entries;
+ struct IFD ifd;
+ gushort ushort_temp1;
+ gchar *str = NULL;
+
+ if(!raw_get_ushort(rawfile, offset, &number_of_entries))
+ return FALSE;
+
+ if (number_of_entries>5000)
+ return FALSE;
+
+ offset += 2;
+
+ while(number_of_entries--)
+ {
+ read_ifd(rawfile, offset, &ifd);
+ offset += 12;
+
+ switch(ifd.tag)
+ {
+ case 0x0202: /* LensSerialNumber */
+ /* FIXME: odd data at this address? */
+ str = raw_strdup(rawfile, offset, 32);
+ break;
+ case 0x0207: /* MinFocalLength */
+ raw_get_ushort(rawfile, offset-4, &ushort_temp1);
+ meta->lens_min_focal = ushort_temp1;
+ break;
+ case 0x0208: /* MaxFocalLength */
+ raw_get_ushort(rawfile, offset-4, &ushort_temp1);
+ meta->lens_max_focal = ushort_temp1;
+ break;
+ }
+ }
+ return TRUE;
+}
+
+
+static gboolean
makernote_olympus(RAWFILE *rawfile, guint base, guint offset, RSMetadata *meta)
{
gushort number_of_entries;
@@ -846,6 +888,10 @@
raw_get_ushort(rawfile, offset, &ushort_temp1);
meta->cam_mul[2] = (gdouble) ushort_temp1 / 256.0;
break;
+ case 0x2010: /* Equipment2 */
+ raw_get_uint(rawfile, offset, &uint_temp1);
+ makernote_olympus_equipment(rawfile, base+uint_temp1, base+uint_temp1, meta);
+ break;
case 0x2020: /* Olympus CameraSettings Tags */
raw_get_uint(rawfile, offset, &uint_temp1);
makernote_olympus_camerasettings(rawfile, base+uint_temp1, base+uint_temp1, meta);
More information about the Rawstudio-commit
mailing list