main.html
Main Page
|
classes.html
Alphabetical List
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
functions.html
Data Fields
|
globals.html
Globals
dir_000000.html
libexif
&raquo
dir_000002.html
olympus
mnote-olympus-entry.c
mnote-olympus-entry_8c.html
Go to the documentation of this file.
00001
/* mnote-olympus-entry.c
00002
*
00003
* Copyright ? 2002 Lutz M?ller <lutz@users.sourceforge.net>
00004
*
00005
* This library is free software; you can redistribute it and/or
00006
* modify it under the terms of the GNU Lesser General Public
00007
* License as published by the Free Software Foundation; either
00008
* version 2 of the License, or (at your option) any later version.
00009
*
00010
* This library is distributed in the hope that it will be useful,
00011
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00012
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013
* Lesser General Public License for more details.
00014
*
00015
* You should have received a copy of the GNU Lesser General Public
00016
* License along with this library; if not, write to the
00017
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018
* Boston, MA 02111-1307, USA.
00019
*/
00020
00021
#include <config.h>
00022
#include "
mnote-olympus-entry_8h.html
mnote-olympus-entry.h
"
00023
00024
#include <stdio.h>
00025
#include <stdlib.h>
00026
#include <string.h>
00027
00028
#include <
exif-format_8h.html
libexif/exif-format.h
>
00029
#include <
exif-utils_8h.html
libexif/exif-utils.h
>
00030
#include <
exif-entry_8h.html
libexif/exif-entry.h
>
00031
#include <
i18n_8h.html
libexif/i18n.h
>
00032
mnote-olympus-entry_8c.html#a0
00033
#define CF(format,target,v,maxlen)                              \
00034
{                                                               \
00035
if (format != target) {                                 \
00036
snprintf (v, maxlen,                            \
00037
_("Invalid format '%s', "               \
00038
"expected '%s'."),                      \
00039
exif_format_get_name (format),          \
00040
exif_format_get_name (target));         \
00041
break;                                          \
00042
}                                                       \
00043
}
00044
mnote-olympus-entry_8c.html#a1
00045
#define CC(number,target,v,maxlen)                                      \
00046
{                                                                       \
00047
if (number != target) {                                         \
00048
snprintf (v, maxlen,                                    \
00049
_("Invalid number of components (%i, "          \
00050
"expected %i)."), (int) number, (int) target);  \
00051
break;                                                  \
00052
}                                                               \
00053
}
00054
mnote-olympus-entry_8c.html#a2
00055
#define CC2(number,t1,t2,v,maxlen)                                      \
00056
{                                                                       \
00057
if ((number != t1) && (number != t2)) {                         \
00058
snprintf (v, maxlen,                                    \
00059
_("Invalid number of components (%i, "          \
00060
"expected %i or %i)."), (int) number,           \
00061
(int) t1, (int) t2);                            \
00062
break;                                                  \
00063
}                                                               \
00064
}
00065
00066
static
struct
{
mnote-olympus-entry_8c.html#a3
00067
exif-tag_8h.html#a153
ExifTag
mnote-canon-tag_8c.html#a0
tag
;
mnote-olympus-entry_8c.html#a4
00068
exif-format_8h.html#a14
ExifFormat
mnote-olympus-entry_8c.html#a4
fmt
;
00069
struct
{
mnote-olympus-entry_8c.html#a5
00070
int
exif-entry_8c.html#a5
index
;
mnote-olympus-entry_8c.html#a6
00071
const
char
*
mnote-olympus-entry_8c.html#a6
string
;
00072         }
exif-entry_8c.html#a7
elem
[10];
00073 }
mnote-olympus-entry_8c.html#a8
items
[] = {
00074   {
mnote-olympus-tag_8h.html#a88a25
MNOTE_NIKON_TAG_LENSTYPE
,
exif-format_8h.html#a14a0
EXIF_FORMAT_BYTE
,
00075     { {0,
i18n_8h.html#a7
N_
(
"AF non D Lens"
)},
00076       {1,
i18n_8h.html#a7
N_
(
"Manual"
)},
00077       {2,
i18n_8h.html#a7
N_
(
"AF-D or AF-S Lens"
)},
00078       {6,
i18n_8h.html#a7
N_
(
"AF-D G Lens"
)},
00079       {10,
i18n_8h.html#a7
N_
(
"AF-D VR Lens"
)},
00080       {0, NULL}}},
00081   {
mnote-olympus-tag_8h.html#a88a29
MNOTE_NIKON_TAG_FLASHUSED
,
exif-format_8h.html#a14a0
EXIF_FORMAT_BYTE
,
00082     { {0,
i18n_8h.html#a7
N_
(
"Flash did not fire"
)},
00083       {4,
i18n_8h.html#a7
N_
(
"Flash unit unknown"
)},
00084       {7,
i18n_8h.html#a7
N_
(
"Flash is external"
)},
00085       {9,
i18n_8h.html#a7
N_
(
"Flash is on Camera"
)},
00086       {0, NULL}}},
00087   {
mnote-olympus-tag_8h.html#a88a59
MNOTE_NIKON1_TAG_QUALITY
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00088     { {1,
i18n_8h.html#a7
N_
(
"VGA Basic"
)},
00089       {2,
i18n_8h.html#a7
N_
(
"VGA Normal"
)},
00090       {3,
i18n_8h.html#a7
N_
(
"VGA Fine"
)},
00091       {4,
i18n_8h.html#a7
N_
(
"SXGA Basic"
)},
00092       {5,
i18n_8h.html#a7
N_
(
"SXGA Normal"
)},
00093       {6,
i18n_8h.html#a7
N_
(
"SXGA Fine"
)},
00094       {10,
i18n_8h.html#a7
N_
(
"2 MPixel Basic"
)},
00095       {11,
i18n_8h.html#a7
N_
(
"2 MPixel Normal"
)},
00096       {12,
i18n_8h.html#a7
N_
(
"2 MPixel Fine"
)},
00097       {0, NULL}}},
00098   {
mnote-olympus-tag_8h.html#a88a60
MNOTE_NIKON1_TAG_COLORMODE
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00099     { {1,
i18n_8h.html#a7
N_
(
"Color"
)},
00100       {2,
i18n_8h.html#a7
N_
(
"Monochrome"
)},
00101       {0, NULL}}},
00102   {
mnote-olympus-tag_8h.html#a88a61
MNOTE_NIKON1_TAG_IMAGEADJUSTMENT
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00103     { {0,
i18n_8h.html#a7
N_
(
"Normal"
)},
00104       {1,
i18n_8h.html#a7
N_
(
"Bright+"
)},
00105       {2,
i18n_8h.html#a7
N_
(
"Bright-"
)},
00106       {3,
i18n_8h.html#a7
N_
(
"Contrast+"
)},
00107       {4,
i18n_8h.html#a7
N_
(
"Contrast-"
)},
00108       {0, NULL}}},
00109   {
mnote-olympus-tag_8h.html#a88a62
MNOTE_NIKON1_TAG_CCDSENSITIVITY
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00110     { {0,
i18n_8h.html#a7
N_
(
"ISO80"
)},
00111       {2,
i18n_8h.html#a7
N_
(
"ISO160"
)},
00112       {4,
i18n_8h.html#a7
N_
(
"ISO320"
)},
00113       {5,
i18n_8h.html#a7
N_
(
"ISO100"
)},
00114       {0, NULL}}},
00115   {
mnote-olympus-tag_8h.html#a88a63
MNOTE_NIKON1_TAG_WHITEBALANCE
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00116     { {0,
i18n_8h.html#a7
N_
(
"Auto"
)},
00117       {1,
i18n_8h.html#a7
N_
(
"Preset"
)},
00118       {2,
i18n_8h.html#a7
N_
(
"Daylight"
)},
00119       {3,
i18n_8h.html#a7
N_
(
"Incandescense"
)},
00120       {4,
i18n_8h.html#a7
N_
(
"Fluorescence"
)},
00121       {5,
i18n_8h.html#a7
N_
(
"Cloudy"
)},
00122       {6,
i18n_8h.html#a7
N_
(
"SpeedLight"
)},
00123       {0, NULL}}},
00124   {
mnote-olympus-tag_8h.html#a88a67
MNOTE_NIKON1_TAG_CONVERTER
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00125     { {0,
i18n_8h.html#a7
N_
(
"No Fisheye"
)},
00126       {1,
i18n_8h.html#a7
N_
(
"Fisheye On"
)},
00127       {0, NULL}}},
00128   {
mnote-olympus-tag_8h.html#a88a69
MNOTE_OLYMPUS_TAG_QUALITY
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00129     { {1,
i18n_8h.html#a7
N_
(
"SQ"
)},
00130       {2,
i18n_8h.html#a7
N_
(
"HQ"
)},
00131       {3,
i18n_8h.html#a7
N_
(
"SHQ"
)},
00132       {0, NULL}}},
00133   {
mnote-olympus-tag_8h.html#a88a70
MNOTE_OLYMPUS_TAG_MACRO
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00134     { {0,
i18n_8h.html#a7
N_
(
"No"
)},
00135       {1,
i18n_8h.html#a7
N_
(
"Yes"
)},
00136       {0, NULL}}},
00137   {
mnote-olympus-tag_8h.html#a88a72
MNOTE_OLYMPUS_TAG_DIGIZOOM
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00138     { {0,
i18n_8h.html#a7
N_
(
"1x"
)},
00139       {2,
i18n_8h.html#a7
N_
(
"2x"
)},
00140       {0, NULL}}},
00141   {
mnote-olympus-tag_8h.html#a88a79
MNOTE_OLYMPUS_TAG_FLASHMODE
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00142     { {0,
i18n_8h.html#a7
N_
(
"Auto"
)},
00143       {1,
i18n_8h.html#a7
N_
(
"Red-eye reduction"
)},
00144       {2,
i18n_8h.html#a7
N_
(
"Fill"
)},
00145       {3,
i18n_8h.html#a7
N_
(
"Off"
)},
00146       {0, NULL}}},
00147   {
mnote-olympus-tag_8h.html#a88a82
MNOTE_OLYMPUS_TAG_SHARPNESS
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00148     { {0,
i18n_8h.html#a7
N_
(
"Normal"
)},
00149       {1,
i18n_8h.html#a7
N_
(
"Hard"
)},
00150       {2,
i18n_8h.html#a7
N_
(
"Soft"
)},
00151       {0, NULL}}},
00152   {
mnote-olympus-tag_8h.html#a88a84
MNOTE_OLYMPUS_TAG_CONTRAST
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00153     { {0,
i18n_8h.html#a7
N_
(
"Hard"
)},
00154       {1,
i18n_8h.html#a7
N_
(
"Normal"
)},
00155       {2,
i18n_8h.html#a7
N_
(
"Soft"
)},
00156       {0, NULL}}},
00157   {
mnote-olympus-tag_8h.html#a88a80
MNOTE_OLYMPUS_TAG_MANFOCUS
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
,
00158     { {0,
i18n_8h.html#a7
N_
(
"No"
)},
00159       {1,
i18n_8h.html#a7
N_
(
"Yes"
)},
00160       {0, NULL}}},
00161   { 0, }
00162 };
00163
00164
char
*
mnote-olympus-entry_8h.html#a1
00165
mnote-olympus-entry_8c.html#a9
mnote_olympus_entry_get_value
(
struct__MnoteOlympusEntry.html
MnoteOlympusEntry
*entry,
char
*v,
unsigned
int
maxlen)
00166 {
00167
char
buf[30];
00168
exif-utils_8h.html#a6
ExifLong
vl;
00169
exif-utils_8h.html#a4
ExifShort
vs = 0;
00170
structExifRational.html
ExifRational
vr;
00171
int
i, j;
00172
double
r, b;
00173
00174
if
(!entry)
00175
return
(NULL);
00176
00177         memset (v, 0, maxlen);
00178         maxlen--;
00179
00180
if
((!entry->
struct__MnoteOlympusEntry.html#o3
data
) && (entry->
struct__MnoteOlympusEntry.html#o2
components
> 0))
return
(v);
00181
00182
switch
(entry->
struct__MnoteOlympusEntry.html#o0
tag
) {
00183
00184
/* Nikon */
00185
case
mnote-olympus-tag_8h.html#a88a1
MNOTE_NIKON_TAG_FIRMWARE
:
00186
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, v, maxlen);
00187
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 4, v, maxlen);
00188                 vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00189
if
((vl & 0xF0F0F0F0) == 0x30303030) {
00190                         memcpy (v, entry->
struct__MnoteOlympusEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, 4));
00191                 }
else
{
00192                         snprintf (v, maxlen,
"%04lx"
, (
long
unsigned
int
) vl);
00193                 }
00194
break
;
00195
case
mnote-olympus-tag_8h.html#a88a2
MNOTE_NIKON_TAG_ISO
:
00196
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, v, maxlen);
00197
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 2, v, maxlen);
00198
//vs = exif_get_short (entry->data, entry->order);
00199                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
+ 2, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00200                 snprintf (v, maxlen,
"ISO %hd"
, vs);
00201
break
;
00202
case
mnote-olympus-tag_8h.html#a88a17
MNOTE_NIKON_TAG_ISO2
:
00203
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, v, maxlen);
00204
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 2, v, maxlen);
00205
//vs = exif_get_short (entry->data, entry->order);
00206                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
+ 2, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00207                 snprintf (v, maxlen,
"ISO2 %hd"
, vs);
00208
break
;
00209
case
mnote-olympus-tag_8h.html#a88a4
MNOTE_NIKON_TAG_QUALITY
:
00210
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, v, maxlen);
00211
//CC (entry->components, 8, v, maxlen);
00212
//vl =  exif_get_long (entry->data  , entry->order);
00213
//printf("-> 0x%04x\n",entry->data);
00214
//printf("-> 0x%s<\n",entry->data - 0);
00215                 memcpy(v, entry->
struct__MnoteOlympusEntry.html#o3
data
,entry->
struct__MnoteOlympusEntry.html#o2
components
);
00216
//snprintf (v, maxlen, "%s<",  ( entry->data - 9  );
00217
break
;
00218
case
mnote-olympus-tag_8h.html#a88a35
MNOTE_NIKON_TAG_COLORMODE
:
00219
case
mnote-olympus-tag_8h.html#a88a3
MNOTE_NIKON_TAG_COLORMODE1
:
00220
case
mnote-olympus-tag_8h.html#a88a5
MNOTE_NIKON_TAG_WHITEBALANCE
:
00221
case
mnote-olympus-tag_8h.html#a88a6
MNOTE_NIKON_TAG_SHARPENING
:
00222
case
mnote-olympus-tag_8h.html#a88a7
MNOTE_NIKON_TAG_FOCUSMODE
:
00223
case
mnote-olympus-tag_8h.html#a88a8
MNOTE_NIKON_TAG_FLASHSETTING
:
00224
case
mnote-olympus-tag_8h.html#a88a14
MNOTE_NIKON_TAG_ISOSELECTION
:
00225
case
mnote-olympus-tag_8h.html#a88a9
MNOTE_NIKON_TAG_FLASHMODE
:
00226
case
mnote-olympus-tag_8h.html#a88a22
MNOTE_NIKON_TAG_IMAGEADJUSTMENT
:
00227
case
mnote-olympus-tag_8h.html#a88a24
MNOTE_NIKON_TAG_ADAPTER
:
00228
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, v, maxlen);
00229                 memcpy(v, entry->
struct__MnoteOlympusEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, entry->
struct__MnoteOlympusEntry.html#o2
components
));
00230
break
;
00231
case
mnote-olympus-tag_8h.html#a88a48
MNOTE_NIKON_TAG_TOTALPICTURES
:
00232
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
, v, maxlen);
00233
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00234                 vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00235                 snprintf (v, maxlen,
"%lu"
,  (
long
unsigned
int
) vl );
00236
break
;
00237
case
mnote-olympus-tag_8h.html#a88a10
MNOTE_NIKON_TAG_WHITEBALANCEFINE
:
00238
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a7
EXIF_FORMAT_SSHORT
, v, maxlen);
00239
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00240                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00241                 snprintf (v, maxlen,
"%hd"
, vs);
00242
break
;
00243
case
mnote-olympus-tag_8h.html#a88a11
MNOTE_NIKON_TAG_WHITEBALANCERB
:
00244
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00245
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 4, v, maxlen);
00246                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00247                 r = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00248                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
+8, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00249                 b = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00250
//printf("numerator %li, denominator %li\n", vr.numerator, vr.denominator);
00251                 snprintf (v, maxlen,
"Red Correction %f, Blue Correction %f"
, r,b);
00252
break
;
00253
case
mnote-olympus-tag_8h.html#a88a27
MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE
:
00254
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00255
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00256                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00257
if
(vr.
structExifRational.html#o0
numerator
) {
00258                         r = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00259                         snprintf (v, maxlen,
"%2.2f meters"
, r);
00260                 }
else
{
00261                         strncpy (v,
i18n_8h.html#a6
_
(
"No manual focus selection"
), maxlen);
00262                 }
00263
break
;
00264
case
mnote-olympus-tag_8h.html#a88a28
MNOTE_NIKON_TAG_DIGITALZOOM
:
00265
case
mnote-olympus-tag_8h.html#a88a66
MNOTE_NIKON1_TAG_DIGITALZOOM
:
00266
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00267
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00268                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00269                 r = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00270                 snprintf (v, maxlen,
"%2.2f"
, r);
00271
break
;
00272
case
mnote-olympus-tag_8h.html#a88a30
MNOTE_NIKON_TAG_AFFOCUSPOSITION
:
00273
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, v, maxlen);
00274
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 4, v, maxlen);
00275
switch
(  *( entry->
struct__MnoteOlympusEntry.html#o3
data
+1)  ) {
00276
case
0: strncpy (v,
"AF Position: Center"
, maxlen);
break
;
00277
case
1: strncpy (v,
"AF Position: Top"
, maxlen);
break
;
00278
case
2: strncpy (v,
"AF Position: Bottom"
, maxlen);
break
;
00279
case
3: strncpy (v,
"AF Position: Left"
, maxlen);
break
;
00280
case
4: strncpy (v,
"AF Position: Right"
, maxlen);
break
;
00281
default
: strncpy (v,
"Unknown AF Position"
, maxlen);
00282                 }
00283
break
;
00284
case
mnote-olympus-tag_8h.html#a88a72
MNOTE_OLYMPUS_TAG_DIGIZOOM
:
00285
if
(entry->
struct__MnoteOlympusEntry.html#o1
format
==
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
) {
00286
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00287                         vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00288                         r = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00289
if
(!vr.
structExifRational.html#o0
numerator
) {
00290                                 strncpy (v,
i18n_8h.html#a6
_
(
"None"
), maxlen);
00291                         }
else
{
00292                                 snprintf (v, maxlen,
"%2.2f"
, r);
00293                         }
00294
break
;
00295                 }
00296
/* fall through to handle SHORT version of this tag */
00297
case
mnote-olympus-tag_8h.html#a88a25
MNOTE_NIKON_TAG_LENSTYPE
:
00298
case
mnote-olympus-tag_8h.html#a88a29
MNOTE_NIKON_TAG_FLASHUSED
:
00299
case
mnote-olympus-tag_8h.html#a88a59
MNOTE_NIKON1_TAG_QUALITY
:
00300
case
mnote-olympus-tag_8h.html#a88a60
MNOTE_NIKON1_TAG_COLORMODE
:
00301
case
mnote-olympus-tag_8h.html#a88a61
MNOTE_NIKON1_TAG_IMAGEADJUSTMENT
:
00302
case
mnote-olympus-tag_8h.html#a88a62
MNOTE_NIKON1_TAG_CCDSENSITIVITY
:
00303
case
mnote-olympus-tag_8h.html#a88a63
MNOTE_NIKON1_TAG_WHITEBALANCE
:
00304
case
mnote-olympus-tag_8h.html#a88a67
MNOTE_NIKON1_TAG_CONVERTER
:
00305
case
mnote-olympus-tag_8h.html#a88a69
MNOTE_OLYMPUS_TAG_QUALITY
:
00306
case
mnote-olympus-tag_8h.html#a88a70
MNOTE_OLYMPUS_TAG_MACRO
:
00307
case
mnote-olympus-tag_8h.html#a88a79
MNOTE_OLYMPUS_TAG_FLASHMODE
:
00308
case
mnote-olympus-tag_8h.html#a88a82
MNOTE_OLYMPUS_TAG_SHARPNESS
:
00309
case
mnote-olympus-tag_8h.html#a88a84
MNOTE_OLYMPUS_TAG_CONTRAST
:
00310
case
mnote-olympus-tag_8h.html#a88a80
MNOTE_OLYMPUS_TAG_MANFOCUS
:
00311
/* search the tag */
00312
for
(i = 0; (
mnote-olympus-entry_8c.html#a8
items
[i].
mnote-canon-tag_8c.html#a0
tag
&&
mnote-olympus-entry_8c.html#a8
items
[i].
mnote-canon-tag_8c.html#a0
tag
!= entry->
struct__MnoteOlympusEntry.html#o0
tag
); i++);
00313
if
(!
mnote-olympus-entry_8c.html#a8
items
[i].
mnote-canon-tag_8c.html#a0
tag
) {
00314                         strncpy (v,
"Internal error"
, maxlen);
00315
break
;
00316                 }
00317
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
mnote-olympus-entry_8c.html#a8
items
[i].fmt, v, maxlen);
00318
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00319
switch
(entry->
struct__MnoteOlympusEntry.html#o1
format
) {
00320
case
exif-format_8h.html#a14a0
EXIF_FORMAT_BYTE
:
00321
case
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
:
00322                         vs = entry->
struct__MnoteOlympusEntry.html#o3
data
[0];
00323
break
;
00324
case
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
:
00325                         vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00326
break
;
00327
default
:
00328                         vs = 0;
00329
break
;
00330                 }
00331
/* find the value */
00332
for
(j = 0;
mnote-olympus-entry_8c.html#a8
items
[i].
exif-entry_8c.html#a7
elem
[j].
mnote-olympus-entry_8c.html#a6
string
&&
00333                             (
mnote-olympus-entry_8c.html#a8
items
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a5
index
< vs); j++);
00334
if
(
mnote-olympus-entry_8c.html#a8
items
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a5
index
!= vs) {
00335                         snprintf (v, maxlen,
"Unknown value %hi"
, vs);
00336
break
;
00337                 }
00338                 strncpy (v,
mnote-olympus-entry_8c.html#a8
items
[i].
exif-entry_8c.html#a7
elem
[j].
mnote-olympus-entry_8c.html#a6
string
, maxlen);
00339
break
;
00340
00341
case
mnote-olympus-tag_8h.html#a88a26
MNOTE_NIKON_TAG_LENS
:
00342
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00343
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 4, v, maxlen);
00344                 {
00345
double
c,d;
00346
unsigned
long
a,b;
00347                         vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00348                         a = vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00349                         vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
+8, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00350                         b = vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00351                         vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
+16, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00352                         c = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00353                         vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
+24, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00354                         d = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00355
//printf("numerator %li, denominator %li\n", vr.numerator, vr.denominator);
00356                         snprintf (v, maxlen,
"%ld-%ldmm 1:%3.1f - %3.1f"
,a,b,c,d);
00357                 }
00358
break
;
00359
case
mnote-olympus-tag_8h.html#a88a64
MNOTE_NIKON1_TAG_FOCUS
:
00360
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00361
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00362                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00363
if
(!vr.
structExifRational.html#o1
denominator
) {
00364                         strncpy (v,
i18n_8h.html#a6
_
(
"Infinite"
), maxlen);
00365                 }
else
{
00366                         r = (double)vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00367                         snprintf (v, maxlen,
"%2.2f"
, r);
00368                 }
00369
break
;
00370
00371
/* Olympus */
00372
case
mnote-olympus-tag_8h.html#a88a68
MNOTE_OLYMPUS_TAG_MODE
:
00373
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
, v, maxlen);
00374
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 3, v, maxlen);
00375                 vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00376
switch
(vl) {
00377
case
0:
00378                         strncpy (v,
i18n_8h.html#a6
_
(
"normal"
), maxlen);
00379
break
;
00380
case
1:
00381                         strncpy (v,
i18n_8h.html#a6
_
(
"unknown"
), maxlen);
00382
break
;
00383
case
2:
00384                         strncpy (v,
i18n_8h.html#a6
_
(
"fast"
), maxlen);
00385
break
;
00386
case
3:
00387                         strncpy (v,
i18n_8h.html#a6
_
(
"panorama"
), maxlen);
00388
break
;
00389
default
:
00390                         snprintf (v, maxlen,
i18n_8h.html#a6
_
(
"%li"
), (
long
int
) vl);
00391                 }
00392                 vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
+ 4, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00393                 snprintf (buf,
sizeof
(buf),
"/%li/"
, (
long
int
) vl);
00394                 strncat (v, buf, maxlen - strlen (v));
00395                 vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
+ 4, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00396
switch
(vl) {
00397
case
1:
00398                         strncat (v,
i18n_8h.html#a6
_
(
"left to right"
), maxlen - strlen (v));
00399
break
;
00400
case
2:
00401                         strncat (v,
i18n_8h.html#a6
_
(
"right to left"
), maxlen - strlen (v));
00402
break
;
00403
case
3:
00404                         strncat (v,
i18n_8h.html#a6
_
(
"bottom to top"
), maxlen - strlen (v));
00405
break
;
00406
case
4:
00407                         strncat (v,
i18n_8h.html#a6
_
(
"top to bottom"
), maxlen - strlen (v));
00408
break
;
00409
default
:
00410                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
"%li"
),
00411                                   (
long
int
) vl);
00412                         strncat (v, buf, maxlen - strlen (v));
00413                 }
00414
break
;
00415
case
mnote-olympus-tag_8h.html#a88a71
MNOTE_OLYMPUS_TAG_UNKNOWN_1
:
00416
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, v, maxlen);
00417
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00418                 strncpy (v,
i18n_8h.html#a6
_
(
"Unknown tag."
), maxlen);
00419
break
;
00420
case
mnote-olympus-tag_8h.html#a88a73
MNOTE_OLYMPUS_TAG_UNKNOWN_2
:
00421
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00422
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00423
break
;
00424
case
mnote-olympus-tag_8h.html#a88a74
MNOTE_OLYMPUS_TAG_UNKNOWN_3
:
00425
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a7
EXIF_FORMAT_SSHORT
, v, maxlen);
00426
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00427
break
;
00428
case
mnote-olympus-tag_8h.html#a88a75
MNOTE_OLYMPUS_TAG_VERSION
:
00429
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, v, maxlen);
00430
mnote-canon-entry_8c.html#a2
CC2
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 5, 8, v, maxlen);
00431                 strncpy (v, (
char
*)entry->
struct__MnoteOlympusEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, entry->
struct__MnoteOlympusEntry.html#o4
size
));
00432
break
;
00433
case
mnote-olympus-tag_8h.html#a88a76
MNOTE_OLYMPUS_TAG_INFO
:
00434
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, v, maxlen);
00435
mnote-canon-entry_8c.html#a2
CC2
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 52, 53, v, maxlen);
00436                 strncpy (v, (
char
*)entry->
struct__MnoteOlympusEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, entry->
struct__MnoteOlympusEntry.html#o4
size
));
00437
break
;
00438
case
mnote-olympus-tag_8h.html#a88a77
MNOTE_OLYMPUS_TAG_ID
:
00439
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, v, maxlen);
00440
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 32, v, maxlen);
00441                 strncpy (v, (
char
*)entry->
struct__MnoteOlympusEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, entry->
struct__MnoteOlympusEntry.html#o4
size
));
00442
break
;
00443
case
mnote-olympus-tag_8h.html#a88a78
MNOTE_OLYMPUS_TAG_UNKNOWN_4
:
00444
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
, v, maxlen);
00445
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 30, v, maxlen);
00446
break
;
00447
case
mnote-olympus-tag_8h.html#a88a81
MNOTE_OLYMPUS_TAG_FOCUSDIST
:
00448
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, v, maxlen);
00449
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 1, v, maxlen);
00450                 vr =
exif-utils_8c.html#a10
exif_get_rational
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00451
if
(vr.
structExifRational.html#o0
numerator
== 0) {
00452                         strncpy (v,
i18n_8h.html#a6
_
(
"Unknown"
), maxlen);
00453                 }
00454
else
{
00455
unsigned
long
tmp = vr.
structExifRational.html#o0
numerator
/ vr.
structExifRational.html#o1
denominator
;
00456
/* printf("numerator %li, denominator %li\n", vr.numerator, vr.denominator); */
00457                         snprintf (v, maxlen,
"%li mm"
, tmp);
00458                 }
00459
break
;
00460
case
mnote-olympus-tag_8h.html#a88a83
MNOTE_OLYMPUS_TAG_WBALANCE
:
00461
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteOlympusEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, v, maxlen);
00462
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteOlympusEntry.html#o2
components
, 2, v, maxlen);
00463                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00464
switch
(vs) {
00465
case
1:
00466                         strncpy (v,
i18n_8h.html#a6
_
(
"Automatic"
), maxlen);
00467
break
;
00468
case
2:
00469                         {
00470
exif-utils_8h.html#a4
ExifShort
v2 =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
+ 2, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00471
unsigned
long
colorTemp = 0;
00472
switch
(v2) {
00473
case
2:
00474                                         colorTemp = 3000;
00475
break
;
00476
case
3:
00477                                         colorTemp = 3700;
00478
break
;
00479
case
4:
00480                                         colorTemp = 4000;
00481
break
;
00482
case
5:
00483                                         colorTemp = 4500;
00484
break
;
00485
case
6:
00486                                         colorTemp = 5500;
00487
break
;
00488
case
7:
00489                                         colorTemp = 6500;
00490
break
;
00491
case
9:
00492                                         colorTemp = 7500;
00493
break
;
00494                                 }
00495
if
(colorTemp) {
00496                                         snprintf (v, maxlen,
"Manual: %liK"
, colorTemp);
00497                                 }
00498
else
{
00499                                         strncpy (v,
i18n_8h.html#a6
_
(
"Manual: Unknown"
), maxlen);
00500                                 }
00501
00502                         }
00503
break
;
00504
case
3:
00505                         strncpy (v,
i18n_8h.html#a6
_
(
"One-touch"
), maxlen);
00506
break
;
00507
default
:
00508                         strncpy (v,
i18n_8h.html#a6
_
(
"Unknown"
), maxlen);
00509
break
;
00510                 }
00511
break
;
00512
default
:
00513
switch
(entry->
struct__MnoteOlympusEntry.html#o1
format
) {
00514
case
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
:
00515                         strncpy (v, (
char
*)entry->
struct__MnoteOlympusEntry.html#o3
data
,
00516
exif-loader_8c.html#a5
MIN
(maxlen, entry->
struct__MnoteOlympusEntry.html#o2
components
));
00517
break
;
00518
case
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
:
00519                         vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00520                         snprintf (v, maxlen,
"%hi"
, vs);
00521
break
;
00522
case
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
:
00523                         vl =
exif-utils_8c.html#a7
exif_get_long
(entry->
struct__MnoteOlympusEntry.html#o3
data
, entry->
struct__MnoteOlympusEntry.html#o5
order
);
00524                         snprintf (v, maxlen,
"%li"
, (
long
int
) vl);
00525
break
;
00526
case
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
:
00527
default
:
00528                         snprintf (v, maxlen,
i18n_8h.html#a6
_
(
"%li bytes unknown data: "
),
00529                                   (
long
int
) entry->
struct__MnoteOlympusEntry.html#o4
size
);
00530
for
(i = 0; i < (
int
)entry->
struct__MnoteOlympusEntry.html#o4
size
; i++) {
00531                                 sprintf (buf,
"%02x"
, entry->
struct__MnoteOlympusEntry.html#o3
data
[i]);
00532                                 strncat (v, buf, maxlen - strlen (v));
00533                         }
00534
break
;
00535                 }
00536
break
;
00537         }
00538
00539
return
(v);
00540 }
Generated on Fri Sep 9 16:28:11 2005 for EXIF library (libexif) Internals by
http://www.doxygen.org/index.html
doxygen
1.4.4
