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
exif-entry.c
exif-entry_8c.html
Go to the documentation of this file.
00001
/* exif-entry.c
00002
*
00003
* Copyright ? 2001 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
00023
#include <
exif-entry_8h.html
libexif/exif-entry.h
>
00024
#include <
exif-ifd_8h.html
libexif/exif-ifd.h
>
00025
#include <
exif-utils_8h.html
libexif/exif-utils.h
>
00026
#include <
i18n_8h.html
libexif/i18n.h
>
00027
00028
#include <ctype.h>
00029
#include <stdlib.h>
00030
#include <stdio.h>
00031
#include <string.h>
00032
#include <time.h>
00033
#include <math.h>
00034
struct__ExifEntryPrivate.html
00035
struct
struct__ExifEntryPrivate.html
_ExifEntryPrivate
00036 {
struct__ExifEntryPrivate.html#o0
00037
unsigned
int
struct__ExifEntryPrivate.html#o0
ref_count
;
00038
struct__ExifEntryPrivate.html#o1
00039
struct__ExifMem.html
ExifMem
*
struct__ExifEntryPrivate.html#o1
mem
;
00040 };
00041
00042
/* This function is hidden in exif-data.c */
00043
struct__ExifLog.html
ExifLog
*
exif-data_8c.html#a43
exif_data_get_log
(
struct__ExifData.html
ExifData
*);
00044
00045
static
void
exif-entry_8c.html#a10
00046
exif-entry_8c.html#a10
exif_entry_log
(
struct__ExifEntry.html
ExifEntry
*e,
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
,
const
char
*
exif-format_8c.html#a0
format
, ...)
00047 {
00048         va_list args;
00049
struct__ExifLog.html
ExifLog
*l = NULL;
00050
00051
if
(e && e->
struct__ExifEntry.html#o5
parent
&& e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
00052                 l =
exif-data_8c.html#a43
exif_data_get_log
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00053         va_start (args, format);
00054
exif-log_8c.html#a13
exif_logv
(l, code,
"ExifEntry"
, format, args);
00055         va_end (args);
00056 }
00057
00058
static
void
*
exif-entry_8c.html#a11
00059
exif-entry_8c.html#a11
exif_entry_alloc
(
struct__ExifEntry.html
ExifEntry
*e,
unsigned
int
i)
00060 {
00061
void
*d;
00062
struct__ExifLog.html
ExifLog
*l = NULL;
00063
00064
if
(!e || !e->
struct__ExifEntry.html#o6
priv
|| !i)
return
NULL;
00065
00066         d =
exif-mem_8c.html#a7
exif_mem_alloc
(e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o1
mem
, i);
00067
if
(d)
return
d;
00068
00069
if
(e->
struct__ExifEntry.html#o5
parent
&& e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
00070                 l =
exif-data_8c.html#a43
exif_data_get_log
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00071
exif-log_8h.html#a0
EXIF_LOG_NO_MEMORY
(l,
"ExifEntry"
, i);
00072
return
NULL;
00073 }
00074
00075
static
void
*
exif-entry_8c.html#a12
00076
exif-entry_8c.html#a12
exif_entry_realloc
(
struct__ExifEntry.html
ExifEntry
*e,
void
*d_orig,
unsigned
int
i)
00077 {
00078
void
*d;
00079
struct__ExifLog.html
ExifLog
*l = NULL;
00080
00081
if
(!e || !e->
struct__ExifEntry.html#o6
priv
)
return
NULL;
00082
00083
if
(!i) {
exif-mem_8c.html#a6
exif_mem_free
(e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o1
mem
, d_orig);
return
NULL; }
00084
00085         d =
exif-mem_8c.html#a8
exif_mem_realloc
(e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o1
mem
, d_orig, i);
00086
if
(d)
return
d;
00087
00088
if
(e->
struct__ExifEntry.html#o5
parent
&& e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
00089                 l =
exif-data_8c.html#a43
exif_data_get_log
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00090
exif-log_8h.html#a0
EXIF_LOG_NO_MEMORY
(l,
"ExifEntry"
, i);
00091
return
NULL;
00092 }
00093
00094
struct__ExifEntry.html
ExifEntry
*
exif-entry_8h.html#a3
00095
exif-entry_8c.html#a13
exif_entry_new
(
void
)
00096 {
00097
struct__ExifMem.html
ExifMem
*mem =
exif-mem_8c.html#a9
exif_mem_new_default
();
00098
struct__ExifEntry.html
ExifEntry
*e =
exif-entry_8c.html#a14
exif_entry_new_mem
(mem);
00099
00100
exif-mem_8c.html#a5
exif_mem_unref
(mem);
00101
00102
return
e;
00103 }
00104
00105
struct__ExifEntry.html
ExifEntry
*
exif-entry_8h.html#a4
00106
exif-entry_8c.html#a14
exif_entry_new_mem
(
struct__ExifMem.html
ExifMem
*mem)
00107 {
00108
struct__ExifEntry.html
ExifEntry
*e = NULL;
00109
00110         e =
exif-mem_8c.html#a7
exif_mem_alloc
(mem,
sizeof
(
struct__ExifEntry.html
ExifEntry
));
00111
if
(!e)
return
NULL;
00112         e->
struct__ExifEntry.html#o6
priv
=
exif-mem_8c.html#a7
exif_mem_alloc
(mem,
sizeof
(
struct__ExifEntryPrivate.html
ExifEntryPrivate
));
00113
if
(!e->
struct__ExifEntry.html#o6
priv
) {
exif-mem_8c.html#a6
exif_mem_free
(mem, e);
return
NULL; }
00114         e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o0
ref_count
= 1;
00115
00116         e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o1
mem
= mem;
00117
exif-mem_8c.html#a4
exif_mem_ref
(mem);
00118
00119
return
e;
00120 }
00121
00122
void
exif-entry_8h.html#a5
00123
exif-entry_8c.html#a15
exif_entry_ref
(
struct__ExifEntry.html
ExifEntry
*e)
00124 {
00125
if
(!e)
return
;
00126
00127         e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o0
ref_count
++;
00128 }
00129
00130
void
exif-entry_8h.html#a6
00131
exif-entry_8c.html#a16
exif_entry_unref
(
struct__ExifEntry.html
ExifEntry
*e)
00132 {
00133
if
(!e)
return
;
00134
00135         e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o0
ref_count
--;
00136
if
(!e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o0
ref_count
)
00137
exif-entry_8c.html#a17
exif_entry_free
(e);
00138 }
00139
00140
void
exif-entry_8h.html#a7
00141
exif-entry_8c.html#a17
exif_entry_free
(
struct__ExifEntry.html
ExifEntry
*e)
00142 {
00143
if
(!e)
return
;
00144
00145
if
(e->
struct__ExifEntry.html#o6
priv
) {
00146
struct__ExifMem.html
ExifMem
*mem = e->
struct__ExifEntry.html#o6
priv
->
struct__ExifEntryPrivate.html#o1
mem
;
00147
if
(e->
struct__ExifEntry.html#o3
data
)
00148
exif-mem_8c.html#a6
exif_mem_free
(mem, e->
struct__ExifEntry.html#o3
data
);
00149
exif-mem_8c.html#a6
exif_mem_free
(mem, e->
struct__ExifEntry.html#o6
priv
);
00150
exif-mem_8c.html#a6
exif_mem_free
(mem, e);
00151
exif-mem_8c.html#a5
exif_mem_unref
(mem);
00152         }
00153 }
00154
00155
void
exif-entry_8h.html#a9
00156
exif-entry_8c.html#a18
exif_entry_fix
(
struct__ExifEntry.html
ExifEntry
*e)
00157 {
00158
unsigned
int
i;
00159
exif-byte-order_8h.html#a3
ExifByteOrder
o;
00160
structExifRational.html
ExifRational
r;
00161
structExifSRational.html
ExifSRational
sr;
00162
00163
if
(!e || !e->
struct__ExifEntry.html#o6
priv
)
return
;
00164
00165
switch
(e->
struct__ExifEntry.html#o0
tag
) {
00166
00167
/* These tags all need to be of format SHORT. */
00168
case
exif-tag_8h.html#a153a65
EXIF_TAG_YCBCR_SUB_SAMPLING
:
00169
case
exif-tag_8h.html#a153a102
EXIF_TAG_SUBJECT_AREA
:
00170
case
exif-tag_8h.html#a153a110
EXIF_TAG_COLOR_SPACE
:
00171
case
exif-tag_8h.html#a153a51
EXIF_TAG_PLANAR_CONFIGURATION
:
00172
case
exif-tag_8h.html#a153a122
EXIF_TAG_SENSING_METHOD
:
00173
case
exif-tag_8h.html#a153a45
EXIF_TAG_ORIENTATION
:
00174
case
exif-tag_8h.html#a153a66
EXIF_TAG_YCBCR_POSITIONING
:
00175
case
exif-tag_8h.html#a153a38
EXIF_TAG_PHOTOMETRIC_INTERPRETATION
:
00176
case
exif-tag_8h.html#a153a126
EXIF_TAG_CUSTOM_RENDERED
:
00177
case
exif-tag_8h.html#a153a127
EXIF_TAG_EXPOSURE_MODE
:
00178
case
exif-tag_8h.html#a153a128
EXIF_TAG_WHITE_BALANCE
:
00179
case
exif-tag_8h.html#a153a131
EXIF_TAG_SCENE_CAPTURE_TYPE
:
00180
case
exif-tag_8h.html#a153a132
EXIF_TAG_GAIN_CONTROL
:
00181
case
exif-tag_8h.html#a153a134
EXIF_TAG_SATURATION
:
00182
case
exif-tag_8h.html#a153a133
EXIF_TAG_CONTRAST
:
00183
case
exif-tag_8h.html#a153a135
EXIF_TAG_SHARPNESS
:
00184
switch
(e->
struct__ExifEntry.html#o1
format
) {
00185
case
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
:
00186
if
(!e->
struct__ExifEntry.html#o5
parent
|| !e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
break
;
00187                         o =
exif-data_8c.html#a37
exif_data_get_byte_order
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00188
for
(i = 0; i < e->components; i++)
00189
exif-utils_8c.html#a4
exif_set_short
(
00190                                         e->
struct__ExifEntry.html#o3
data
+ i *
00191
exif-format_8c.html#a5
exif_format_get_size
(
00192
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
), o,
00193                                         (
exif-utils_8h.html#a4
ExifShort
)
exif-utils_8c.html#a7
exif_get_long
(
00194                                         e->
struct__ExifEntry.html#o3
data
+ i *
00195
exif-format_8c.html#a5
exif_format_get_size
(
00196
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
), o));
00197                         e->
struct__ExifEntry.html#o1
format
= EXIF_FORMAT_SHORT;
00198                         e->
struct__ExifEntry.html#o4
size
= e->
struct__ExifEntry.html#o2
components
*
00199
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
);
00200                         e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a12
exif_entry_realloc
(e, e->
struct__ExifEntry.html#o3
data
, e->
struct__ExifEntry.html#o4
size
);
00201
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00202
"Tag '%s' was of format '%s' (which is "
00203
"against specification) and has been "
00204
"changed to format '%s'."
,
00205
exif-tag_8c.html#a26
exif_tag_get_name
(e->
struct__ExifEntry.html#o0
tag
),
00206
exif-format_8c.html#a4
exif_format_get_name
(EXIF_FORMAT_LONG),
00207
exif-format_8c.html#a4
exif_format_get_name
(EXIF_FORMAT_SHORT));
00208
break
;
00209
case
EXIF_FORMAT_SHORT:
00210
default
:
00211
break
;
00212                 }
00213
break
;
00214
00215
/* All these tags need to be of format 'Rational'. */
00216
case
exif-tag_8h.html#a153a77
EXIF_TAG_FNUMBER
:
00217
case
exif-tag_8h.html#a153a93
EXIF_TAG_APERTURE_VALUE
:
00218
case
exif-tag_8h.html#a153a76
EXIF_TAG_EXPOSURE_TIME
:
00219
case
exif-tag_8h.html#a153a101
EXIF_TAG_FOCAL_LENGTH
:
00220
switch
(e->
struct__ExifEntry.html#o1
format
) {
00221
case
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
:
00222
if
(!e->
struct__ExifEntry.html#o5
parent
|| !e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
break
;
00223                         o =
exif-data_8c.html#a37
exif_data_get_byte_order
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00224
for
(i = 0; i < e->components; i++) {
00225                                 sr =
exif-utils_8c.html#a9
exif_get_srational
(e->
struct__ExifEntry.html#o3
data
+ i *
00226
exif-format_8c.html#a5
exif_format_get_size
(
00227
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
), o);
00228                                 r.
structExifRational.html#o0
numerator
= (
exif-utils_8h.html#a6
ExifLong
) sr.
structExifSRational.html#o0
numerator
;
00229                                 r.
structExifRational.html#o1
denominator
= (
exif-utils_8h.html#a6
ExifLong
) sr.
structExifSRational.html#o1
denominator
;
00230
exif-utils_8c.html#a11
exif_set_rational
(e->
struct__ExifEntry.html#o3
data
+ i *
00231
exif-format_8c.html#a5
exif_format_get_size
(
00232
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
), o, r);
00233                         }
00234                         e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
;
00235
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00236
"Tag '%s' was of format '%s' (which is "
00237
"against specification) and has been "
00238
"changed to format '%s'."
,
00239
exif-tag_8c.html#a26
exif_tag_get_name
(e->
struct__ExifEntry.html#o0
tag
),
00240
exif-format_8c.html#a4
exif_format_get_name
(
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
),
00241
exif-format_8c.html#a4
exif_format_get_name
(
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
));
00242
break
;
00243
default
:
00244
break
;
00245                 }
00246
break
;
00247
00248
case
exif-tag_8h.html#a153a105
EXIF_TAG_USER_COMMENT
:
00249
00250
/* Format needs to be UNDEFINED. */
00251
if
(e->
struct__ExifEntry.html#o1
format
!=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
) {
00252
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00253
"Tag 'UserComment' had invalid format '%s'. "
00254
"Format has been set to 'undefined'."
,
00255
exif-format_8c.html#a4
exif_format_get_name
(e->format));
00256                         e->format =
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
00257                 }
00258
00259
/* Some packages like Canon ZoomBrowser EX 4.5 store
00260
only one zero byte followed by 7 bytes of rubbish */
00261
if
((e->
struct__ExifEntry.html#o4
size
>= 8) && (e->
struct__ExifEntry.html#o3
data
[0] == 0)) {
00262                         memcpy(e->
struct__ExifEntry.html#o3
data
,
"\0\0\0\0\0\0\0\0"
, 8);
00263                 }
00264
00265
/* There need to be at least 8 bytes. */
00266
if
(e->
struct__ExifEntry.html#o4
size
< 8) {
00267                         e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a12
exif_entry_realloc
(e, e->
struct__ExifEntry.html#o3
data
, 8 + e->
struct__ExifEntry.html#o4
size
);
00268
if
(!e->
struct__ExifEntry.html#o3
data
) {
00269                                 e->
struct__ExifEntry.html#o4
size
= 0;
00270                                 e->
struct__ExifEntry.html#o2
components
= 0;
00271
return
;
00272                         }
00273
00274
/* Assume ASCII */
00275                         memmove (e->
struct__ExifEntry.html#o3
data
+ 8, e->
struct__ExifEntry.html#o3
data
, e->
struct__ExifEntry.html#o4
size
);
00276                         memcpy (e->
struct__ExifEntry.html#o3
data
,
"ASCII\0\0\0"
, 8);
00277                         e->
struct__ExifEntry.html#o4
size
+= 8;
00278                         e->
struct__ExifEntry.html#o2
components
+= 8;
00279
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00280
"Tag 'UserComment' has been expanded to at "
00281
"least 8 bytes in order to follow the "
00282
"specification."
);
00283
break
;
00284                 }
00285
00286
/*
00287
* If the first 8 bytes are empty and real data starts
00288
* afterwards, let's assume ASCII and claim the 8 first
00289
* bytes for the format specifyer.
00290
*/
00291
for
(i = 0; (i < e->
exif-format_8c.html#a2
size
) && !e->
struct__ExifEntry.html#o3
data
[i]; i++);
00292
if
(!i)
for
( ; (i < e->size) && (e->
struct__ExifEntry.html#o3
data
[i] ==
' '
); i++);
00293
if
((i >= 8) && (i < e->size)) {
00294
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00295
"Tag 'UserComment' is not empty but does not start with "
00296
"format identifyer. This has been fixed."
);
00297                         memcpy (e->data,
"ASCII\0\0\0"
, 8);
00298
break
;
00299                 }
00300
00301
/*
00302
* First 8 bytes need to follow the specification. If they don't,
00303
* assume ASCII.
00304
*/
00305
if
(memcmp (e->
struct__ExifEntry.html#o3
data
,
"ASCII\0\0\0"
, 8) &&
00306                     memcmp (e->
struct__ExifEntry.html#o3
data
,
"UNICODE\0"
, 8) &&
00307                     memcmp (e->
struct__ExifEntry.html#o3
data
,
"JIS\0\0\0\0\0"
, 8) &&
00308                     memcmp (e->
struct__ExifEntry.html#o3
data
,
"\0\0\0\0\0\0\0\0"
, 8)) {
00309                         e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a12
exif_entry_realloc
(e, e->
struct__ExifEntry.html#o3
data
, 8 + e->
struct__ExifEntry.html#o4
size
);
00310
if
(!e->
struct__ExifEntry.html#o3
data
) {
00311                                 e->
struct__ExifEntry.html#o4
size
= 0;
00312                                 e->
struct__ExifEntry.html#o2
components
= 0;
00313
break
;
00314                         }
00315
00316
/* Assume ASCII */
00317                         memmove (e->
struct__ExifEntry.html#o3
data
+ 8, e->
struct__ExifEntry.html#o3
data
, e->
struct__ExifEntry.html#o4
size
);
00318                         memcpy (e->
struct__ExifEntry.html#o3
data
,
"ASCII\0\0\0"
, 8);
00319                         e->
struct__ExifEntry.html#o4
size
+= 8;
00320                         e->
struct__ExifEntry.html#o2
components
+= 8;
00321
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00322
"Tag 'UserComment' did not start with "
00323
"format identifyer. This has been fixed."
);
00324
break
;
00325                 }
00326
00327
break
;
00328
default
:
00329
break
;
00330         }
00331 }
00332
00333
void
exif-entry_8h.html#a11
00334
exif-entry_8c.html#a19
exif_entry_dump
(
struct__ExifEntry.html
ExifEntry
*e,
unsigned
int
indent)
00335 {
00336
char
buf[1024];
00337
char
mnote-canon-entry_8c.html#a5
value
[1024];
00338
unsigned
int
i;
00339
00340
for
(i = 0; i < 2 * indent; i++)
00341                 buf[i] =
' '
;
00342         buf[i] =
'\0'
;
00343
00344
if
(!e)
00345
return
;
00346
00347         printf (
"%sTag: 0x%x ('%s')\n"
, buf, e->
struct__ExifEntry.html#o0
tag
,
00348
exif-tag_8c.html#a26
exif_tag_get_name
(e->
struct__ExifEntry.html#o0
tag
));
00349         printf (
"%s  Format: %i ('%s')\n"
, buf, e->
struct__ExifEntry.html#o1
format
,
00350
exif-format_8c.html#a4
exif_format_get_name
(e->
struct__ExifEntry.html#o1
format
));
00351         printf (
"%s  Components: %i\n"
, buf, (
int
) e->
struct__ExifEntry.html#o2
components
);
00352         printf (
"%s  Size: %i\n"
, buf, e->
struct__ExifEntry.html#o4
size
);
00353         printf (
"%s  Value: %s\n"
, buf,
exif-entry_8c.html#a20
exif_entry_get_value
(e, value,
sizeof
(value)));
00354 }
00355
exif-entry_8c.html#a0
00356
#define CF(entry,target,v,maxlen)                                       \
00357
{                                                                       \
00358
if (entry->format != target) {                                  \
00359
exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,      \
00360
_("The tag '%s' contains data of an invalid "   \
00361
"format ('%s', expected '%s')."),               \
00362
exif_tag_get_name (entry->tag),                 \
00363
exif_format_get_name (entry->format),           \
00364
exif_format_get_name (target));                 \
00365
break;                                                  \
00366
}                                                               \
00367
}
00368
exif-entry_8c.html#a1
00369
#define CC(entry,target,v,maxlen)                                       \
00370
{                                                                       \
00371
if (entry->components != target) {                              \
00372
exif_entry_log (entry, EXIF_LOG_CODE_CORRUPT_DATA,      \
00373
_("The tag '%s' contains an invalid number of " \
00374
"components (%i, expected %i)."),             \
00375
exif_tag_get_name (entry->tag),         \
00376
(int) entry->components, (int) target);         \
00377
break;                                                  \
00378
}                                                               \
00379
}
00380
00381
static
struct
{
exif-entry_8c.html#a2
00382
exif-tag_8h.html#a153
ExifTag
mnote-canon-tag_8c.html#a0
tag
;
exif-entry_8c.html#a3
00383
const
char
*
exif-entry_8c.html#a3
strings
[10];
00384 }
exif-entry_8c.html#a4
list
[] = {
00385   {
exif-tag_8h.html#a153a51
EXIF_TAG_PLANAR_CONFIGURATION
,
00386     {
i18n_8h.html#a7
N_
(
"chunky format"
),
i18n_8h.html#a7
N_
(
"planar format"
), NULL}},
00387   {
exif-tag_8h.html#a153a122
EXIF_TAG_SENSING_METHOD
,
00388     {
""
,
i18n_8h.html#a7
N_
(
"Not defined"
),
i18n_8h.html#a7
N_
(
"One-chip color area sensor"
),
00389
i18n_8h.html#a7
N_
(
"Two-chip color area sensor"
),
i18n_8h.html#a7
N_
(
"Three-chip color area sensor"
),
00390
i18n_8h.html#a7
N_
(
"Color sequential area sensor"
),
""
,
i18n_8h.html#a7
N_
(
"Trilinear sensor"
),
00391
i18n_8h.html#a7
N_
(
"Color sequential linear sensor"
), NULL}},
00392   {
exif-tag_8h.html#a153a45
EXIF_TAG_ORIENTATION
,
00393     {
""
,
i18n_8h.html#a7
N_
(
"top - left"
),
i18n_8h.html#a7
N_
(
"top - right"
),
i18n_8h.html#a7
N_
(
"bottom - right"
),
00394
i18n_8h.html#a7
N_
(
"bottom - left"
),
i18n_8h.html#a7
N_
(
"left - top"
),
i18n_8h.html#a7
N_
(
"right - top"
),
00395
i18n_8h.html#a7
N_
(
"right - bottom"
),
i18n_8h.html#a7
N_
(
"left - bottom"
), NULL}},
00396   {
exif-tag_8h.html#a153a66
EXIF_TAG_YCBCR_POSITIONING
,
00397     {
""
,
i18n_8h.html#a7
N_
(
"centered"
),
i18n_8h.html#a7
N_
(
"co-sited"
), NULL}},
00398   {
exif-tag_8h.html#a153a38
EXIF_TAG_PHOTOMETRIC_INTERPRETATION
, {
""
,
i18n_8h.html#a7
N_
(
"RGB"
),
i18n_8h.html#a7
N_
(
"YCbCr"
), NULL}},
00399   {
exif-tag_8h.html#a153a126
EXIF_TAG_CUSTOM_RENDERED
,
00400     {
i18n_8h.html#a7
N_
(
"Normal process"
),
i18n_8h.html#a7
N_
(
"Custom process"
), NULL}},
00401   {
exif-tag_8h.html#a153a127
EXIF_TAG_EXPOSURE_MODE
,
00402     {
i18n_8h.html#a7
N_
(
"Auto exposure"
),
i18n_8h.html#a7
N_
(
"Manual exposure"
),
i18n_8h.html#a7
N_
(
"Auto bracket"
), NULL}},
00403   {
exif-tag_8h.html#a153a128
EXIF_TAG_WHITE_BALANCE
,
00404     {
i18n_8h.html#a7
N_
(
"Auto white balance"
),
i18n_8h.html#a7
N_
(
"Manual white balance"
), NULL}},
00405   {
exif-tag_8h.html#a153a131
EXIF_TAG_SCENE_CAPTURE_TYPE
,
00406     {
i18n_8h.html#a7
N_
(
"Standard"
),
i18n_8h.html#a7
N_
(
"Landscape"
),
i18n_8h.html#a7
N_
(
"Portrait"
),
00407
i18n_8h.html#a7
N_
(
"Night scene"
), NULL}},
00408   {
exif-tag_8h.html#a153a132
EXIF_TAG_GAIN_CONTROL
,
00409     {
i18n_8h.html#a7
N_
(
"Normal"
),
i18n_8h.html#a7
N_
(
"Low gain up"
),
i18n_8h.html#a7
N_
(
"High gain up"
),
00410
i18n_8h.html#a7
N_
(
"Low gain down"
),
i18n_8h.html#a7
N_
(
"High gain down"
), NULL}},
00411   {
exif-tag_8h.html#a153a134
EXIF_TAG_SATURATION
,
00412     {
i18n_8h.html#a7
N_
(
"Normal"
),
i18n_8h.html#a7
N_
(
"Low saturation"
),
i18n_8h.html#a7
N_
(
"High saturation"
), NULL}},
00413   {
exif-tag_8h.html#a153a133
EXIF_TAG_CONTRAST
, {
i18n_8h.html#a7
N_
(
"Normal"
),
i18n_8h.html#a7
N_
(
"Soft"
),
i18n_8h.html#a7
N_
(
"Hard"
), NULL}},
00414   {
exif-tag_8h.html#a153a135
EXIF_TAG_SHARPNESS
, {
i18n_8h.html#a7
N_
(
"Normal"
),
i18n_8h.html#a7
N_
(
"Soft"
),
i18n_8h.html#a7
N_
(
"Hard"
), NULL}},
00415   { 0, {NULL}}
00416 };
00417
00418
static
struct
{
00419
exif-tag_8h.html#a153
ExifTag
mnote-canon-tag_8c.html#a0
tag
;
00420
struct
{
exif-entry_8c.html#a5
00421
int
exif-entry_8c.html#a5
index
;
exif-entry_8c.html#a6
00422
const
char
*
exif-entry_8c.html#a6
values
[4];
00423   }
exif-entry_8c.html#a7
elem
[25];
00424 }
exif-entry_8c.html#a8
list2
[] = {
00425   {
exif-tag_8h.html#a153a98
EXIF_TAG_METERING_MODE
,
00426     { {  0, {
i18n_8h.html#a7
N_
(
"Unknown"
), NULL}},
00427       {  1, {
i18n_8h.html#a7
N_
(
"Average"
),
i18n_8h.html#a7
N_
(
"avg"
), NULL}},
00428       {  2, {
i18n_8h.html#a7
N_
(
"Center-Weighted Average"
),
i18n_8h.html#a7
N_
(
"Center-Weight"
), NULL}},
00429       {  3, {
i18n_8h.html#a7
N_
(
"Spot"
), NULL}},
00430       {  4, {
i18n_8h.html#a7
N_
(
"Multi Spot"
), NULL}},
00431       {  5, {
i18n_8h.html#a7
N_
(
"Pattern"
), NULL}},
00432       {  6, {
i18n_8h.html#a7
N_
(
"Partial"
), NULL}},
00433       {255, {
i18n_8h.html#a7
N_
(
"Other"
), NULL}},
00434       {  0, {NULL}}}},
00435   {
exif-tag_8h.html#a153a37
EXIF_TAG_COMPRESSION
,
00436     { {1, {
i18n_8h.html#a7
N_
(
"Uncompressed"
), NULL}},
00437       {5, {
i18n_8h.html#a7
N_
(
"LZW compression"
), NULL}},
00438       {6, {
i18n_8h.html#a7
N_
(
"JPEG compression"
), NULL}},
00439       {0, {NULL}}}},
00440   {
exif-tag_8h.html#a153a99
EXIF_TAG_LIGHT_SOURCE
,
00441     { {  0, {
i18n_8h.html#a7
N_
(
"Unknown"
), NULL}},
00442       {  1, {
i18n_8h.html#a7
N_
(
"Daylight"
), NULL}},
00443       {  2, {
i18n_8h.html#a7
N_
(
"Fluorescent"
), NULL}},
00444       {  3, {
i18n_8h.html#a7
N_
(
"Tungsten incandescent light"
),
i18n_8h.html#a7
N_
(
"Tungsten"
), NULL}},
00445       {  4, {
i18n_8h.html#a7
N_
(
"Flash"
), NULL}},
00446       {  9, {
i18n_8h.html#a7
N_
(
"Fine weather"
), NULL}},
00447       { 10, {
i18n_8h.html#a7
N_
(
"Cloudy weather"
),
i18n_8h.html#a7
N_
(
"cloudy"
), NULL}},
00448       { 11, {
i18n_8h.html#a7
N_
(
"Shade"
), NULL}},
00449       { 12, {
i18n_8h.html#a7
N_
(
"Daylight fluorescent"
), NULL}},
00450       { 13, {
i18n_8h.html#a7
N_
(
"Day white fluorescent"
), NULL}},
00451       { 14, {
i18n_8h.html#a7
N_
(
"Cool white fluorescent"
), NULL}},
00452       { 15, {
i18n_8h.html#a7
N_
(
"White fluorescent"
), NULL}},
00453       { 17, {
i18n_8h.html#a7
N_
(
"Standard light A"
), NULL}},
00454       { 18, {
i18n_8h.html#a7
N_
(
"Standard light B"
), NULL}},
00455       { 19, {
i18n_8h.html#a7
N_
(
"Standard light C"
), NULL}},
00456       { 20, {
i18n_8h.html#a7
N_
(
"D55"
), NULL}},
00457       { 21, {
i18n_8h.html#a7
N_
(
"D65"
), NULL}},
00458       { 22, {
i18n_8h.html#a7
N_
(
"D75"
), NULL}},
00459       { 24, {
i18n_8h.html#a7
N_
(
"ISO studio tungsten"
),NULL}},
00460       {255, {
i18n_8h.html#a7
N_
(
"Other"
), NULL}},
00461       {  0, {NULL}}}},
00462   {
exif-tag_8h.html#a153a119
EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT
,
00463     { {2, {
i18n_8h.html#a7
N_
(
"Inch"
),
i18n_8h.html#a7
N_
(
"in"
), NULL}},
00464       {3, {
i18n_8h.html#a7
N_
(
"Centimeter"
),
i18n_8h.html#a7
N_
(
"cm"
), NULL}},
00465       {0, {NULL}}}},
00466   {
exif-tag_8h.html#a153a52
EXIF_TAG_RESOLUTION_UNIT
,
00467     { {2, {
i18n_8h.html#a7
N_
(
"Inch"
),
i18n_8h.html#a7
N_
(
"in"
), NULL}},
00468       {3, {
i18n_8h.html#a7
N_
(
"Centimeter"
),
i18n_8h.html#a7
N_
(
"cm"
), NULL}},
00469       {0, {NULL}}}},
00470   {
exif-tag_8h.html#a153a82
EXIF_TAG_EXPOSURE_PROGRAM
,
00471     { {0, {
i18n_8h.html#a7
N_
(
"Not defined"
), NULL}},
00472       {1, {
i18n_8h.html#a7
N_
(
"Manual"
), NULL}},
00473       {2, {
i18n_8h.html#a7
N_
(
"Normal program"
),
i18n_8h.html#a7
N_
(
"Normal"
), NULL}},
00474       {3, {
i18n_8h.html#a7
N_
(
"Aperture priority"
),
i18n_8h.html#a7
N_
(
"Aperture"
), NULL}},
00475       {4, {
i18n_8h.html#a7
N_
(
"Shutter priority"
),
i18n_8h.html#a7
N_
(
"Shutter"
), NULL}},
00476       {5, {
i18n_8h.html#a7
N_
(
"Creative program (biased toward depth of field)"
),
00477
i18n_8h.html#a7
N_
(
"Creative"
), NULL}},
00478       {6, {
i18n_8h.html#a7
N_
(
"Creative program (biased toward fast shutter speed"
),
00479
i18n_8h.html#a7
N_
(
"Action"
), NULL}},
00480       {7, {
i18n_8h.html#a7
N_
(
"Portrait mode (for closeup photos with the background out "
00481
"of focus)"
),
i18n_8h.html#a7
N_
(
"Portrait"
), NULL}},
00482       {8, {
i18n_8h.html#a7
N_
(
"Landscape mode (for landscape photos with the background "
00483
"in focus)"
),
i18n_8h.html#a7
N_
(
"Landscape"
), NULL}},
00484       {0, {NULL}}}},
00485   {
exif-tag_8h.html#a153a100
EXIF_TAG_FLASH
,
00486     { {0x0000, {
i18n_8h.html#a7
N_
(
"Flash did not fire."
),
i18n_8h.html#a7
N_
(
"no flash"
), NULL}},
00487       {0x0001, {
i18n_8h.html#a7
N_
(
"Flash fired."
),
i18n_8h.html#a7
N_
(
"flash"
),
i18n_8h.html#a7
N_
(
"Yes"
), NULL}},
00488       {0x0005, {
i18n_8h.html#a7
N_
(
"Strobe return light not detected."
),
i18n_8h.html#a7
N_
(
"W/o strobe"
),
00489                 NULL}},
00490       {0x0007, {
i18n_8h.html#a7
N_
(
"Strobe return light detected."
),
i18n_8h.html#a7
N_
(
"W. strobe"
), NULL}},
00491       {0x0009, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsatory flash mode"
), NULL}},
00492       {0x000d, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsatory flash mode, return light "
00493
"not detected."
), NULL}},
00494       {0x000f, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsatory flash mode, return light "
00495
"detected."
), NULL}},
00496       {0x0010, {
i18n_8h.html#a7
N_
(
"Flash did not fire, compulsatory flash mode."
), NULL}},
00497       {0x0018, {
i18n_8h.html#a7
N_
(
"Flash did not fire, auto mode."
), NULL}},
00498       {0x0019, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode."
), NULL}},
00499       {0x001d, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode, return light not detected."
),
00500                 NULL}},
00501       {0x001f, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode, return light detected."
), NULL}},
00502       {0x0020, {
i18n_8h.html#a7
N_
(
"No flash function."
),NULL}},
00503       {0x0041, {
i18n_8h.html#a7
N_
(
"Flash fired, red-eye reduction mode."
), NULL}},
00504       {0x0045, {
i18n_8h.html#a7
N_
(
"Flash fired, red-eye reduction mode, return light "
00505
"not detected."
), NULL}},
00506       {0x0047, {
i18n_8h.html#a7
N_
(
"Flash fired, red-eye reduction mode, return light "
00507
"detected."
), NULL}},
00508       {0x0049, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsory flash mode, red-eye reduction "
00509
"mode."
), NULL}},
00510       {0x004d, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsory flash mode, red-eye reduction "
00511
"mode, return light not detected"
), NULL}},
00512       {0x004f, {
i18n_8h.html#a7
N_
(
"Flash fired, compulsory flash mode, red-eye reduction, "
00513
"return light detected"
), NULL}},
00514       {0x0058, {
i18n_8h.html#a7
N_
(
"Flash did not fire, auto mode, red-eye reduction mode"
), NULL}},
00515       {0x0059, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode, red-eye reduction mode"
), NULL}},
00516       {0x005d, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode, return light not detected, "
00517
"red-eye reduction mode."
), NULL}},
00518       {0x005f, {
i18n_8h.html#a7
N_
(
"Flash fired, auto mode, return light detected, "
00519
"red-eye reduction mode."
), NULL}},
00520       {0x0000, {NULL}}}},
00521   {
exif-tag_8h.html#a153a137
EXIF_TAG_SUBJECT_DISTANCE_RANGE
,
00522     { {0, {
i18n_8h.html#a7
N_
(
"Unknown"
),
i18n_8h.html#a7
N_
(
"?"
), NULL}},
00523       {1, {
i18n_8h.html#a7
N_
(
"Macro"
), NULL}},
00524       {2, {
i18n_8h.html#a7
N_
(
"Close view"
),
i18n_8h.html#a7
N_
(
"close"
), NULL}},
00525       {3, {
i18n_8h.html#a7
N_
(
"Distant view"
),
i18n_8h.html#a7
N_
(
"distant"
), NULL}},
00526       {0, {NULL}}}},
00527   {
exif-tag_8h.html#a153a110
EXIF_TAG_COLOR_SPACE
,
00528     { {1, {
i18n_8h.html#a7
N_
(
"sRGB"
), NULL}},
00529       {2, {
i18n_8h.html#a7
N_
(
"Adobe RGB"
), NULL}},
00530       {0xffff, {
i18n_8h.html#a7
N_
(
"Uncalibrated"
), NULL}}}},
00531   {0, }
00532 };
00533
00534
const
char
*
exif-entry_8h.html#a10
00535
exif-entry_8c.html#a20
exif_entry_get_value
(
struct__ExifEntry.html
ExifEntry
*e,
char
*val,
unsigned
int
maxlen)
00536 {
00537
unsigned
int
i, j, k, l, ts;
00538
const
unsigned
char
*t;
00539
exif-utils_8h.html#a2
ExifByte
v_byte;
00540
exif-utils_8h.html#a4
ExifShort
v_short, v_short2, v_short3, v_short4;
00541
exif-utils_8h.html#a6
ExifLong
v_long;
00542
exif-utils_8h.html#a8
ExifSLong
v_slong;
00543
structExifRational.html
ExifRational
v_rat;
00544
structExifSRational.html
ExifSRational
v_srat;
00545
char
b[64];
00546
const
char
*c;
00547
exif-byte-order_8h.html#a3
ExifByteOrder
o;
00548
double
d;
00549
struct__ExifEntry.html
ExifEntry
*entry;
00550
static
struct
{
00551
char
*label;
00552
char
major, minor;
00553         } versions[] = {
00554                 {
"0110"
, 1,  1},
00555                 {
"0120"
, 1,  2},
00556                 {
"0200"
, 2,  0},
00557                 {
"0210"
, 2,  1},
00558                 {
"0220"
, 2,  2},
00559                 {
"0221"
, 2, 21},
00560                 {NULL  , 0,  0}
00561         };
00562
00563
/* FIXME: This belongs to somewhere else. */
00564
/* libexif should use the default system locale.
00565
* If an application specifically requires UTF-8, then we
00566
* must give the application a way to tell libexif that.
00567
*
00568
* bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
00569
*/
00570
i18n_8h.html#a5
bindtextdomain
(GETTEXT_PACKAGE, LOCALEDIR);
00571
00572
/* We need the byte order */
00573
if
(!e || !e->
struct__ExifEntry.html#o5
parent
|| !e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
00574
return
val;
00575         o =
exif-data_8c.html#a37
exif_data_get_byte_order
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
00576
00577         memset (val, 0, maxlen);
00578         memset (b, 0,
sizeof
(b));
00579         maxlen--;
00580
00581
/* Sanity check */
00582
if
(e->
struct__ExifEntry.html#o4
size
!= e->
struct__ExifEntry.html#o2
components
*
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
)) {
00583                 snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"Invalid size of entry (%i, "
00584
"expected %li x %i)."
), e->
struct__ExifEntry.html#o4
size
, e->
struct__ExifEntry.html#o2
components
,
00585
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
));
00586
return
val;
00587         }
00588
00589
switch
(e->
struct__ExifEntry.html#o0
tag
) {
00590
case
exif-tag_8h.html#a153a105
EXIF_TAG_USER_COMMENT
:
00591
00592
/*
00593
* The specification says UNDEFINED, but some
00594
* manufacturers don't care and use ASCII. If this is the
00595
* case here, only refuse to read it if there is no chance
00596
* of finding readable data.
00597
*/
00598
if
((e->
struct__ExifEntry.html#o1
format
!=
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
) ||
00599                     (e->
struct__ExifEntry.html#o4
size
<= 8) ||
00600                     ( memcmp (e->
struct__ExifEntry.html#o3
data
,
"ASCII\0\0\0"
, 8) &&
00601                       memcmp (e->
struct__ExifEntry.html#o3
data
,
"UNICODE\0"
, 8) &&
00602                       memcmp (e->
struct__ExifEntry.html#o3
data
,
"JIS\0\0\0\0\0"
, 8) &&
00603                       memcmp (e->
struct__ExifEntry.html#o3
data
,
"\0\0\0\0\0\0\0\0"
, 8)))
00604
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00605
00606
/*
00607
* Note that, according to the specification (V2.1, p 40),
00608
* the user comment field does not have to be
00609
* NULL terminated.
00610
*/
00611
if
((e->
struct__ExifEntry.html#o4
size
>= 8) && !memcmp (e->
struct__ExifEntry.html#o3
data
,
"ASCII\0\0\0"
, 8)) {
00612                         strncpy (val, (
char
*) e->
struct__ExifEntry.html#o3
data
+ 8,
exif-loader_8c.html#a5
MIN
(e->
struct__ExifEntry.html#o4
size
- 8, maxlen));
00613
break
;
00614                 }
00615
if
((e->
struct__ExifEntry.html#o4
size
>= 8) && !memcmp (e->
struct__ExifEntry.html#o3
data
,
"UNICODE\0"
, 8)) {
00616                         strncpy (val,
i18n_8h.html#a6
_
(
"Unsupported UNICODE string"
), maxlen);
00617
break
;
00618                 }
00619
if
((e->
struct__ExifEntry.html#o4
size
>= 8) && !memcmp (e->
struct__ExifEntry.html#o3
data
,
"JIS\0\0\0\0\0"
, 8)) {
00620                         strncpy (val,
i18n_8h.html#a6
_
(
"Unsupported JIS string"
), maxlen);
00621
break
;
00622                 }
00623
00624
/* Check if there is really some information in the tag. */
00625
for
(i = 0; (i < e->
exif-format_8c.html#a2
size
) &&
00626                             (!e->
struct__ExifEntry.html#o3
data
[i] || (e->
struct__ExifEntry.html#o3
data
[i] ==
' '
)); i++);
00627
if
(i == e->
struct__ExifEntry.html#o4
size
)
break
;
00628
00629
/*
00630
* If we reach this point, the tag does not
00631
* comply with the standard and seems to contain data.
00632
* Print as much as possible.
00633
*/
00634
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00635
"Tag UserComment does not comply "
00636
"with standard but contains data."
);
00637
for
(; (i < e->size)  && (strlen (val) < maxlen - 1); i++) {
00638
exif-entry_8c.html#a10
exif_entry_log
(e,
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
00639
"Byte at position %i: 0x%02x"
, i, e->
struct__ExifEntry.html#o3
data
[i]);
00640                         val[strlen (val)] =
00641                                 isprint (e->
struct__ExifEntry.html#o3
data
[i]) ? e->
struct__ExifEntry.html#o3
data
[i] :
'.'
;
00642                 }
00643
break
;
00644
00645
case
exif-tag_8h.html#a153a87
EXIF_TAG_EXIF_VERSION
:
00646
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00647
mnote-canon-entry_8c.html#a1
CC
(e, 4, val, maxlen);
00648                 strncpy (val,
i18n_8h.html#a6
_
(
"Unknown Exif Version"
), maxlen);
00649
for
(i = 0; versions[i].label; i++) {
00650
if
(!memcmp (e->
struct__ExifEntry.html#o3
data
, versions[i].label, 4)) {
00651                                 snprintf (val, maxlen,
00652
i18n_8h.html#a6
_
(
"Exif Version %d.%d"
),
00653                                         versions[i].major,
00654                                         versions[i].minor);
00655
break
;
00656                         }
00657                 }
00658
break
;
00659
case
exif-tag_8h.html#a153a109
EXIF_TAG_FLASH_PIX_VERSION
:
00660
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00661
mnote-canon-entry_8c.html#a1
CC
(e, 4, val, maxlen);
00662
if
(!memcmp (e->
struct__ExifEntry.html#o3
data
,
"0100"
, 4))
00663                         strncpy (val,
i18n_8h.html#a6
_
(
"FlashPix Version 1.0"
), maxlen);
00664
else
if
(!memcmp (e->
struct__ExifEntry.html#o3
data
,
"0101"
, 4))
00665                         strncpy (val,
i18n_8h.html#a6
_
(
"FlashPix Version 1.01"
), maxlen);
00666
else
00667                         strncpy (val,
i18n_8h.html#a6
_
(
"Unknown FlashPix Version"
), maxlen);
00668
break
;
00669
case
exif-tag_8h.html#a153a75
EXIF_TAG_COPYRIGHT
:
00670
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, val, maxlen);
00671
00672
/*
00673
* First part: Photographer.
00674
* Some cameras store a string like "   " here. Ignore it.
00675
*/
00676
if
(e->
struct__ExifEntry.html#o4
size
&& e->
struct__ExifEntry.html#o3
data
&&
00677                     (strspn ((
char
*)e->
struct__ExifEntry.html#o3
data
,
" "
) != strlen ((
char
*) e->
struct__ExifEntry.html#o3
data
)))
00678                         strncpy (val, (
char
*) e->
struct__ExifEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, e->
struct__ExifEntry.html#o4
size
));
00679
else
00680                         strncpy (val,
i18n_8h.html#a6
_
(
"[None]"
), maxlen);
00681                 strncat (val,
" "
, maxlen - strlen (val));
00682                 strncat (val,
i18n_8h.html#a6
_
(
"(Photographer)"
), maxlen - strlen (val));
00683
00684
/* Second part: Editor. */
00685                 t = e->
struct__ExifEntry.html#o3
data
+ strlen ((
char
*) e->
struct__ExifEntry.html#o3
data
) + 1;
00686                 ts = e->
struct__ExifEntry.html#o3
data
+ e->
struct__ExifEntry.html#o4
size
- t;
00687                 strncat (val,
" - "
, maxlen - strlen (val));
00688
if
(e->
struct__ExifEntry.html#o4
size
&& e->
struct__ExifEntry.html#o3
data
&& (ts > 0) &&
00689                     (strspn ((
char
*)t,
" "
) != ts))
00690                         strncat (val, (
char
*)t,
exif-loader_8c.html#a5
MIN
(maxlen - strlen (val), ts));
00691
else
00692                         strncat (val,
i18n_8h.html#a6
_
(
"[None]"
), maxlen - strlen (val));
00693                 strncat (val,
" "
, maxlen - strlen (val));
00694                 strncat (val,
i18n_8h.html#a6
_
(
"(Editor)"
), maxlen - strlen (val));
00695
00696
break
;
00697
case
exif-tag_8h.html#a153a77
EXIF_TAG_FNUMBER
:
00698
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, val, maxlen);
00699
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00700                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
00701
if
(!v_rat.
structExifRational.html#o1
denominator
)
return
val;
00702                 snprintf (val, maxlen,
"f/%.01f"
, (
float
) v_rat.
structExifRational.html#o0
numerator
/
00703                                                     (
float
) v_rat.
structExifRational.html#o1
denominator
);
00704
break
;
00705
case
exif-tag_8h.html#a153a93
EXIF_TAG_APERTURE_VALUE
:
00706
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, val, maxlen);
00707
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00708                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
00709
if
(!v_rat.
structExifRational.html#o1
denominator
)
return
val;
00710                 snprintf (val, maxlen,
"f/%.01f"
,
00711                           pow (2 , ((
float
) v_rat.
structExifRational.html#o0
numerator
/
00712                                     (
float
) v_rat.
structExifRational.html#o1
denominator
) / 2.));
00713
break
;
00714
case
exif-tag_8h.html#a153a101
EXIF_TAG_FOCAL_LENGTH
:
00715
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, val, maxlen);
00716
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00717                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
00718
if
(!v_rat.
structExifRational.html#o1
denominator
)
return
val;
00719
00720
/*
00721
* For calculation of the 35mm equivalent,
00722
* Minolta cameras need a multiplier that depends on the
00723
* camera model.
00724
*/
00725                 d = 0.;
00726                 entry =
exif-content_8c.html#a8
exif_content_get_entry
(
00727                         e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
->
struct__ExifData.html#o0
ifd
[
exif-ifd_8h.html#a7a0
EXIF_IFD_0
],
exif-tag_8h.html#a153a42
EXIF_TAG_MAKE
);
00728
if
(entry && entry->
struct__ExifEntry.html#o3
data
&&
00729                     !strncmp ((
char
*)entry->
struct__ExifEntry.html#o3
data
,
"Minolta"
, 7)) {
00730                         entry =
exif-content_8c.html#a8
exif_content_get_entry
(
00731                                         e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
->
struct__ExifData.html#o0
ifd
[
exif-ifd_8h.html#a7a0
EXIF_IFD_0
],
00732
exif-tag_8h.html#a153a43
EXIF_TAG_MODEL
);
00733
if
(entry && entry->
struct__ExifEntry.html#o3
data
) {
00734
if
(!strncmp ((
char
*)entry->
struct__ExifEntry.html#o3
data
,
"DiMAGE 7"
, 8))
00735                                         d = 3.9;
00736
else
if
(!strncmp ((
char
*)entry->
struct__ExifEntry.html#o3
data
,
"DiMAGE 5"
, 8))
00737                                         d = 4.9;
00738                         }
00739                 }
00740
if
(d)
00741                         snprintf (b,
sizeof
(b),
i18n_8h.html#a6
_
(
" (35 equivalent: %d mm)"
),
00742                                   (
int
) (d * (
double
) v_rat.
structExifRational.html#o0
numerator
/
00743                                              (
double
) v_rat.
structExifRational.html#o1
denominator
));
00744
00745                 snprintf (val, maxlen,
"%.1f mm"
,
00746                         (
float
) v_rat.
structExifRational.html#o0
numerator
/ (
float
) v_rat.
structExifRational.html#o1
denominator
);
00747
if
(maxlen > strlen (val) + strlen (b))
00748                         strncat (val, b, maxlen - strlen (val) - 1);
00749
break
;
00750
case
exif-tag_8h.html#a153a97
EXIF_TAG_SUBJECT_DISTANCE
:
00751
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, val, maxlen);
00752
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00753                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
00754
if
(!v_rat.
structExifRational.html#o1
denominator
)
return
val;
00755                 snprintf (val, maxlen,
"%.1f m"
, (
float
) v_rat.
structExifRational.html#o0
numerator
/
00756                                                    (
float
) v_rat.
structExifRational.html#o1
denominator
);
00757
break
;
00758
case
exif-tag_8h.html#a153a76
EXIF_TAG_EXPOSURE_TIME
:
00759
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
, val, maxlen);
00760
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00761                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
00762
if
(!v_rat.
structExifRational.html#o1
denominator
)
return
val;
00763                 d = (double) v_rat.
structExifRational.html#o0
numerator
/ (double) v_rat.
structExifRational.html#o1
denominator
;
00764
if
(d < 1)
00765                         snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"1/%d"
),
00766                                   (
int
) (1. / d));
00767
else
00768                         snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"%d"
), (
int
) d);
00769
if
(maxlen > strlen (val) + strlen (
i18n_8h.html#a6
_
(
" sec."
)))
00770                         strncat (val,
i18n_8h.html#a6
_
(
" sec."
), maxlen - strlen (val) - 1);
00771
break
;
00772
case
exif-tag_8h.html#a153a92
EXIF_TAG_SHUTTER_SPEED_VALUE
:
00773
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
, val, maxlen);
00774
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00775                 v_srat =
exif-utils_8c.html#a9
exif_get_srational
(e->
struct__ExifEntry.html#o3
data
, o);
00776
if
(!v_srat.
structExifSRational.html#o1
denominator
)
return
val;
00777                 snprintf (val, maxlen,
"%.0f/%.0f"
, (
float
) v_srat.
structExifSRational.html#o0
numerator
,
00778                           (
float
) v_srat.
structExifSRational.html#o1
denominator
);
00779
if
(maxlen > strlen (val) + strlen (
i18n_8h.html#a6
_
(
" sec."
)))
00780                         strncat (val,
i18n_8h.html#a6
_
(
" sec."
), maxlen - strlen (val) - 1);
00781                 snprintf (b,
sizeof
(b),
" (APEX: %i)"
,
00782                         (
int
) pow (sqrt(2), (
float
) v_srat.
structExifSRational.html#o0
numerator
/
00783                                             (
float
) v_srat.
structExifSRational.html#o1
denominator
));
00784
if
(maxlen > strlen (val) + strlen (b))
00785                         strncat (val, b, maxlen - strlen (val) - 1);
00786
break
;
00787
case
exif-tag_8h.html#a153a94
EXIF_TAG_BRIGHTNESS_VALUE
:
00788
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
, val, maxlen);
00789
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00790                 v_srat =
exif-utils_8c.html#a9
exif_get_srational
(e->
struct__ExifEntry.html#o3
data
, o);
00791                 snprintf (val, maxlen,
"%i/%i"
, (
int
) v_srat.
structExifSRational.html#o0
numerator
,
00792                                                   (
int
) v_srat.
structExifSRational.html#o1
denominator
);
00793
/* FIXME: How do I calculate the APEX value? */
00794
break
;
00795
case
exif-tag_8h.html#a153a123
EXIF_TAG_FILE_SOURCE
:
00796
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00797
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00798
switch
(e->
struct__ExifEntry.html#o3
data
[0]) {
00799
case
0x03: strncpy (val,
i18n_8h.html#a6
_
(
"DSC"
), maxlen);
break
;
00800
default
: snprintf (val, maxlen,
"0x%02x"
, e->
struct__ExifEntry.html#o3
data
[0]);
break
;
00801                 }
00802
break
;
00803
case
exif-tag_8h.html#a153a90
EXIF_TAG_COMPONENTS_CONFIGURATION
:
00804
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00805
mnote-canon-entry_8c.html#a1
CC
(e, 4, val, maxlen);
00806
for
(i = 0; i < 4; i++) {
00807
switch
(e->
struct__ExifEntry.html#o3
data
[i]) {
00808
case
0: c =
i18n_8h.html#a6
_
(
"-"
);
break
;
00809
case
1: c =
i18n_8h.html#a6
_
(
"Y"
);
break
;
00810
case
2: c =
i18n_8h.html#a6
_
(
"Cb"
);
break
;
00811
case
3: c =
i18n_8h.html#a6
_
(
"Cr"
);
break
;
00812
case
4: c =
i18n_8h.html#a6
_
(
"R"
);
break
;
00813
case
5: c =
i18n_8h.html#a6
_
(
"G"
);
break
;
00814
case
6: c =
i18n_8h.html#a6
_
(
"B"
);
break
;
00815
default
: c =
i18n_8h.html#a6
_
(
"reserved"
);
break
;
00816                         }
00817                         strncat (val, c, maxlen - strlen (val));
00818
if
(i < 3) strncat (val,
" "
, maxlen - strlen (val));
00819                 }
00820
break
;
00821
case
exif-tag_8h.html#a153a95
EXIF_TAG_EXPOSURE_BIAS_VALUE
:
00822
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
, val, maxlen);
00823
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00824                 v_srat =
exif-utils_8c.html#a9
exif_get_srational
(e->
struct__ExifEntry.html#o3
data
, o);
00825
if
(!v_srat.
structExifSRational.html#o1
denominator
)
return
val;
00826                 snprintf (val, maxlen,
"%s%.01f"
,
00827                           v_srat.
structExifSRational.html#o1
denominator
* v_srat.
structExifSRational.html#o0
numerator
> 0 ?
"+"
:
""
,
00828                           (
double
) v_srat.
structExifSRational.html#o0
numerator
/
00829                           (
double
) v_srat.
structExifSRational.html#o1
denominator
);
00830
break
;
00831
case
exif-tag_8h.html#a153a65
EXIF_TAG_YCBCR_SUB_SAMPLING
:
00832
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00833
mnote-canon-entry_8c.html#a1
CC
(e, 2, val, maxlen);
00834                 v_short  =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00835                 v_short2 =
exif-utils_8c.html#a2
exif_get_short
(
00836                         e->
struct__ExifEntry.html#o3
data
+
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
),
00837                         o);
00838
if
((v_short == 2) && (v_short2 == 1))
00839                         strncpy (val,
i18n_8h.html#a6
_
(
"YCbCr4:2:2"
), maxlen);
00840
else
if
((v_short == 2) && (v_short2 == 2))
00841                         strncpy (val,
i18n_8h.html#a6
_
(
"YCbCr4:2:0"
), maxlen);
00842
else
00843                         snprintf (val, maxlen,
"%i, %i"
, v_short, v_short2);
00844
break
;
00845
case
exif-tag_8h.html#a153a104
EXIF_TAG_MAKER_NOTE
:
00846
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
, val, maxlen);
00847                 snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"%i bytes unknown data"
),
00848                           (
int
) e->
struct__ExifEntry.html#o2
components
);
00849
break
;
00850
case
exif-tag_8h.html#a153a102
EXIF_TAG_SUBJECT_AREA
:
00851
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00852
switch
(e->
struct__ExifEntry.html#o2
components
) {
00853
case
2:
00854                         v_short  =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00855                         v_short2 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 2, o);
00856                         snprintf (val, maxlen,
"(x,y) = (%i,%i)"
,
00857                                   v_short, v_short2);
00858
break
;
00859
case
3:
00860                         v_short  =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00861                         v_short2 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 2, o);
00862                         v_short3 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 4, o);
00863                         snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"Within distance %i of "
00864
"(x,y) = (%i,%i)"
), v_short3, v_short,
00865                                 v_short2);
00866
break
;
00867
case
4:
00868                         v_short  =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00869                         v_short2 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 2, o);
00870                         v_short3 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 4, o);
00871                         v_short4 =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+ 6, o);
00872                         snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"Within rectangle "
00873
"(width %i, height %i) around "
00874
"(x,y) = (%i,%i)"
), v_short3, v_short4,
00875                                 v_short, v_short2);
00876
break
;
00877
default
:
00878                         snprintf (val, maxlen,
i18n_8h.html#a6
_
(
"Unexpected number "
00879
"of components (%li, expected 2, 3, or 4)."
),
00880                                 e->
struct__ExifEntry.html#o2
components
);
00881                 }
00882
break
;
00883
00884
case
exif-tag_8h.html#a153a98
EXIF_TAG_METERING_MODE
:
00885
case
exif-tag_8h.html#a153a37
EXIF_TAG_COMPRESSION
:
00886
case
exif-tag_8h.html#a153a119
EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT
:
00887
case
exif-tag_8h.html#a153a52
EXIF_TAG_RESOLUTION_UNIT
:
00888
case
exif-tag_8h.html#a153a82
EXIF_TAG_EXPOSURE_PROGRAM
:
00889
case
exif-tag_8h.html#a153a100
EXIF_TAG_FLASH
:
00890
case
exif-tag_8h.html#a153a137
EXIF_TAG_SUBJECT_DISTANCE_RANGE
:
00891
case
exif-tag_8h.html#a153a110
EXIF_TAG_COLOR_SPACE
:
00892
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00893
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00894                 v_short =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00895
00896
/* Search the tag */
00897
for
(i = 0;
exif-entry_8c.html#a8
list2
[i].
mnote-canon-tag_8c.html#a0
tag
&& (
exif-entry_8c.html#a8
list2
[i].
mnote-canon-tag_8c.html#a0
tag
!= e->
struct__ExifEntry.html#o0
tag
); i++);
00898
if
(!
exif-entry_8c.html#a8
list2
[i].
mnote-canon-tag_8c.html#a0
tag
) {
00899                         strncpy (val,
"Internal error."
, maxlen - 1);
00900
break
;
00901                 }
00902
00903
/* Find the value */
00904
for
(j = 0;
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a6
values
&&
00905                             (
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a5
index
< v_short); j++);
00906
if
(
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a5
index
!= v_short) {
00907                         snprintf (val, maxlen,
"Internal error (unknown "
00908
"value %i)."
, v_short);
00909
break
;
00910                 }
00911
00912
/* Find a short enough value */
00913                 memset (val, 0, maxlen);
00914
for
(k = 0;
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a6
values
&&
00915
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a6
values
[k]; k++) {
00916                   l = strlen (
i18n_8h.html#a6
_
(
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a6
values
[k]));
00917
if
((maxlen > l) && (strlen (val) < l))
00918                     strncpy (val,
i18n_8h.html#a6
_
(
exif-entry_8c.html#a8
list2
[i].
exif-entry_8c.html#a7
elem
[j].
exif-entry_8c.html#a6
values
[k]), maxlen - 1);
00919                 }
00920
if
(!strlen (val)) snprintf (val, maxlen,
"%i"
, v_short);
00921
00922
break
;
00923
case
exif-tag_8h.html#a153a51
EXIF_TAG_PLANAR_CONFIGURATION
:
00924
case
exif-tag_8h.html#a153a122
EXIF_TAG_SENSING_METHOD
:
00925
case
exif-tag_8h.html#a153a45
EXIF_TAG_ORIENTATION
:
00926
case
exif-tag_8h.html#a153a66
EXIF_TAG_YCBCR_POSITIONING
:
00927
case
exif-tag_8h.html#a153a38
EXIF_TAG_PHOTOMETRIC_INTERPRETATION
:
00928
case
exif-tag_8h.html#a153a126
EXIF_TAG_CUSTOM_RENDERED
:
00929
case
exif-tag_8h.html#a153a127
EXIF_TAG_EXPOSURE_MODE
:
00930
case
exif-tag_8h.html#a153a128
EXIF_TAG_WHITE_BALANCE
:
00931
case
exif-tag_8h.html#a153a131
EXIF_TAG_SCENE_CAPTURE_TYPE
:
00932
case
exif-tag_8h.html#a153a132
EXIF_TAG_GAIN_CONTROL
:
00933
case
exif-tag_8h.html#a153a134
EXIF_TAG_SATURATION
:
00934
case
exif-tag_8h.html#a153a133
EXIF_TAG_CONTRAST
:
00935
case
exif-tag_8h.html#a153a135
EXIF_TAG_SHARPNESS
:
00936
mnote-canon-entry_8c.html#a0
CF
(e,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00937
mnote-canon-entry_8c.html#a1
CC
(e, 1, val, maxlen);
00938                 v_short =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00939
00940
/* Search the tag */
00941
for
(i = 0;
exif-entry_8c.html#a4
list
[i].tag && (
exif-entry_8c.html#a4
list
[i].tag != e->
struct__ExifEntry.html#o0
tag
); i++);
00942
if
(!
exif-entry_8c.html#a4
list
[i].tag) {
00943                         strncpy (val,
"Internal error."
, maxlen - 1);
00944
break
;
00945                 }
00946
00947
/* Find the value */
00948
for
(j = 0;
exif-entry_8c.html#a4
list
[i].
exif-entry_8c.html#a3
strings
[j] && (j < v_short); j++);
00949
if
(!
exif-entry_8c.html#a4
list
[i].
exif-entry_8c.html#a3
strings
[j])
00950                         snprintf (val, maxlen,
"%i"
, v_short);
00951
else
00952                         strncpy (val,
i18n_8h.html#a6
_
(
exif-entry_8c.html#a4
list
[i].
exif-entry_8c.html#a3
strings
[j]), maxlen - 1);
00953
break
;
00954
default
:
00955
if
(!e->
struct__ExifEntry.html#o2
components
)
break
;
00956
switch
(e->
struct__ExifEntry.html#o1
format
) {
00957
case
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
:
00958
break
;
00959
case
exif-format_8h.html#a14a0
EXIF_FORMAT_BYTE
:
00960
case
exif-format_8h.html#a14a5
EXIF_FORMAT_SBYTE
:
00961                         v_byte = e->
struct__ExifEntry.html#o3
data
[0];
00962                         snprintf (val, maxlen,
"0x%02x"
, v_byte);
00963                         maxlen -= strlen (val);
00964
for
(i = 1; i < e->components; i++) {
00965                                 v_byte = e->
struct__ExifEntry.html#o3
data
[i];
00966                                 snprintf (b,
sizeof
(b),
", 0x%02x"
, v_byte);
00967                                 strncat (val, b, maxlen);
00968                                 maxlen -= strlen (b);
00969
if
((
signed
)maxlen <= 0)
break
;
00970                         }
00971
break
;
00972
case
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
:
00973
case
exif-format_8h.html#a14a7
EXIF_FORMAT_SSHORT
:
00974                         v_short =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
, o);
00975                         snprintf (val, maxlen,
"%i"
, v_short);
00976                         maxlen -= strlen (val);
00977
for
(i = 1; i < e->components; i++) {
00978                                 v_short =
exif-utils_8c.html#a2
exif_get_short
(e->
struct__ExifEntry.html#o3
data
+
00979
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) *
00980                                         i, o);
00981                                 snprintf (b,
sizeof
(b),
", %i"
, v_short);
00982                                 strncat (val, b, maxlen);
00983                                 maxlen -= strlen (b);
00984
if
((
signed
)maxlen <= 0)
break
;
00985                         }
00986
break
;
00987
case
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
:
00988                         v_long =
exif-utils_8c.html#a7
exif_get_long
(e->
struct__ExifEntry.html#o3
data
, o);
00989                         snprintf (val, maxlen,
"%li"
, (
long
int
) v_long);
00990                         maxlen -= strlen (val);
00991
for
(i = 1; i < e->components; i++) {
00992                                 v_long =
exif-utils_8c.html#a7
exif_get_long
(e->
struct__ExifEntry.html#o3
data
+
00993
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) *
00994                                         i, o);
00995                                 snprintf (b,
sizeof
(b),
", %li"
,
00996                                         (
long
int
) v_long);
00997                                 strncat (val, b, maxlen);
00998                                 maxlen -= strlen (b);
00999
if
((
signed
)maxlen <= 0)
break
;
01000                         }
01001
break
;
01002
case
exif-format_8h.html#a14a8
EXIF_FORMAT_SLONG
:
01003                         v_slong =
exif-utils_8c.html#a5
exif_get_slong
(e->
struct__ExifEntry.html#o3
data
, o);
01004                         snprintf (val, maxlen,
"%li"
, (
long
int
) v_slong);
01005                         maxlen -= strlen (val);
01006
for
(i = 1; i < e->components; i++) {
01007                                 v_long =
exif-utils_8c.html#a5
exif_get_slong
(e->
struct__ExifEntry.html#o3
data
+
01008
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) *
01009                                         i, o);
01010                                 snprintf (b,
sizeof
(b),
", %li"
,
01011                                                 (
long
int
) v_long);
01012                                 strncat (val, b, maxlen);
01013                                 maxlen -= strlen (b);
01014
if
((
signed
)maxlen <= 0)
break
;
01015                         }
01016
break
;
01017
case
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
:
01018                         strncpy (val, (
char
*) e->
struct__ExifEntry.html#o3
data
,
exif-loader_8c.html#a5
MIN
(maxlen, e->
struct__ExifEntry.html#o4
size
));
01019
break
;
01020
case
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
:
01021                         v_rat =
exif-utils_8c.html#a10
exif_get_rational
(e->
struct__ExifEntry.html#o3
data
, o);
01022
if
(v_rat.
structExifRational.html#o1
denominator
) {
01023                                 snprintf (val, maxlen,
"%2.2f"
, (
double
)v_rat.
structExifRational.html#o0
numerator
/ v_rat.
structExifRational.html#o1
denominator
);
01024                         }
else
{
01025                                 snprintf (val, maxlen,
"%i/%i"
, v_rat.
structExifRational.html#o0
numerator
,  v_rat.
structExifRational.html#o1
denominator
);
01026                         }
01027                         maxlen -= strlen (val);
01028
for
(i = 1; i < e->components; i++) {
01029                                 v_rat =
exif-utils_8c.html#a10
exif_get_rational
(
01030                                         e->
struct__ExifEntry.html#o3
data
+ 8 * i, o);
01031                                 snprintf (b,
sizeof
(b),
", %2.2f"
,
01032                                            (
double
)v_rat.
structExifRational.html#o0
numerator
/ v_rat.
structExifRational.html#o1
denominator
);
01033                                 strncat (val, b, maxlen);
01034                                 maxlen -= strlen (b);
01035
if
((
signed
)maxlen <= 0)
break
;
01036                         }
01037
break
;
01038
case
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
:
01039                         v_srat =
exif-utils_8c.html#a9
exif_get_srational
(e->
struct__ExifEntry.html#o3
data
, o);
01040
if
(v_srat.
structExifSRational.html#o1
denominator
) {
01041                                 snprintf (val, maxlen,
"%2.2f"
, (
double
)v_srat.
structExifSRational.html#o0
numerator
/ v_srat.
structExifSRational.html#o1
denominator
);
01042                         }
else
{
01043                                 snprintf (val, maxlen,
"%i/%i"
, v_srat.
structExifSRational.html#o0
numerator
,  v_srat.
structExifSRational.html#o1
denominator
);
01044                         }
01045                         maxlen -= strlen (val);
01046
for
(i = 1; i < e->components; i++) {
01047                                 v_srat =
exif-utils_8c.html#a9
exif_get_srational
(
01048                                         e->
struct__ExifEntry.html#o3
data
+ 8 * i, o);
01049                                 snprintf (b,
sizeof
(b),
", %2.2f"
,
01050                                           (
double
)v_srat.
structExifSRational.html#o0
numerator
/ v_srat.
structExifSRational.html#o1
denominator
);
01051                                 strncat (val, b, maxlen);
01052                                 maxlen -= strlen (b);
01053
if
((
signed
) maxlen <= 0)
break
;
01054                         }
01055
break
;
01056
case
exif-format_8h.html#a14a11
EXIF_FORMAT_DOUBLE
:
01057
case
exif-format_8h.html#a14a10
EXIF_FORMAT_FLOAT
:
01058
default
:
01059
/* What to do here? */
01060
break
;
01061                 }
01062         }
01063
01064
return
val;
01065 }
01066
01067
void
exif-entry_8h.html#a8
01068
exif-entry_8c.html#a21
exif_entry_initialize
(
struct__ExifEntry.html
ExifEntry
*e,
exif-tag_8h.html#a153
ExifTag
mnote-canon-tag_8c.html#a0
tag
)
01069 {
01070         time_t t;
01071
struct
tm *tm;
01072
structExifRational.html
ExifRational
r;
01073
exif-byte-order_8h.html#a3
ExifByteOrder
o;
01074
01075
/* We need the byte order */
01076
if
(!e || !e->
struct__ExifEntry.html#o5
parent
|| e->
struct__ExifEntry.html#o3
data
|| !e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
)
01077
return
;
01078         o =
exif-data_8c.html#a37
exif_data_get_byte_order
(e->
struct__ExifEntry.html#o5
parent
->
struct__ExifContent.html#o2
parent
);
01079
01080         e->
struct__ExifEntry.html#o0
tag
= tag;
01081
switch
(tag) {
01082
01083
/* LONG, 1 component, no default */
01084
case
exif-tag_8h.html#a153a111
EXIF_TAG_PIXEL_X_DIMENSION
:
01085
case
exif-tag_8h.html#a153a112
EXIF_TAG_PIXEL_Y_DIMENSION
:
01086
case
exif-tag_8h.html#a153a80
EXIF_TAG_EXIF_IFD_POINTER
:
01087
case
exif-tag_8h.html#a153a84
EXIF_TAG_GPS_INFO_IFD_POINTER
:
01088
case
exif-tag_8h.html#a153a114
EXIF_TAG_INTEROPERABILITY_IFD_POINTER
:
01089
case
exif-tag_8h.html#a153a63
EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH
:
01090
case
exif-tag_8h.html#a153a62
EXIF_TAG_JPEG_INTERCHANGE_FORMAT
:
01091                 e->
struct__ExifEntry.html#o2
components
= 1;
01092                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
;
01093                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01094                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01095
break
;
01096
01097
/* SHORT, 1 component, no default */
01098
case
exif-tag_8h.html#a153a120
EXIF_TAG_SUBJECT_LOCATION
:
01099
case
exif-tag_8h.html#a153a122
EXIF_TAG_SENSING_METHOD
:
01100
case
exif-tag_8h.html#a153a38
EXIF_TAG_PHOTOMETRIC_INTERPRETATION
:
01101
case
exif-tag_8h.html#a153a37
EXIF_TAG_COMPRESSION
:
01102
case
exif-tag_8h.html#a153a127
EXIF_TAG_EXPOSURE_MODE
:
01103
case
exif-tag_8h.html#a153a128
EXIF_TAG_WHITE_BALANCE
:
01104
case
exif-tag_8h.html#a153a130
EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM
:
01105
case
exif-tag_8h.html#a153a132
EXIF_TAG_GAIN_CONTROL
:
01106
case
exif-tag_8h.html#a153a137
EXIF_TAG_SUBJECT_DISTANCE_RANGE
:
01107
01108
/* SHORT, 1 component, default 0 */
01109
case
exif-tag_8h.html#a153a34
EXIF_TAG_IMAGE_WIDTH
:
01110
case
exif-tag_8h.html#a153a35
EXIF_TAG_IMAGE_LENGTH
:
01111
case
exif-tag_8h.html#a153a82
EXIF_TAG_EXPOSURE_PROGRAM
:
01112
case
exif-tag_8h.html#a153a99
EXIF_TAG_LIGHT_SOURCE
:
01113
case
exif-tag_8h.html#a153a98
EXIF_TAG_METERING_MODE
:
01114
case
exif-tag_8h.html#a153a126
EXIF_TAG_CUSTOM_RENDERED
:
01115
case
exif-tag_8h.html#a153a131
EXIF_TAG_SCENE_CAPTURE_TYPE
:
01116
case
exif-tag_8h.html#a153a133
EXIF_TAG_CONTRAST
:
01117
case
exif-tag_8h.html#a153a134
EXIF_TAG_SATURATION
:
01118
case
exif-tag_8h.html#a153a135
EXIF_TAG_SHARPNESS
:
01119                 e->
struct__ExifEntry.html#o2
components
= 1;
01120                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01121                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01122                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01123
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 0);
01124
break
;
01125
01126
/* SHORT, 1 component, default 1 */
01127
case
exif-tag_8h.html#a153a45
EXIF_TAG_ORIENTATION
:
01128
case
exif-tag_8h.html#a153a51
EXIF_TAG_PLANAR_CONFIGURATION
:
01129
case
exif-tag_8h.html#a153a66
EXIF_TAG_YCBCR_POSITIONING
:
01130                 e->
struct__ExifEntry.html#o2
components
= 1;
01131                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01132                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01133                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01134
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 1);
01135
break
;
01136
01137
/* SHORT, 1 component, default 2 */
01138
case
exif-tag_8h.html#a153a52
EXIF_TAG_RESOLUTION_UNIT
:
01139
case
exif-tag_8h.html#a153a119
EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT
:
01140                 e->
struct__ExifEntry.html#o2
components
= 1;
01141                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01142                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01143                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01144
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 2);
01145
break
;
01146
01147
/* SHORT, 1 component, default 3 */
01148
case
exif-tag_8h.html#a153a46
EXIF_TAG_SAMPLES_PER_PIXEL
:
01149                 e->
struct__ExifEntry.html#o2
components
= 1;
01150                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01151                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01152                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01153
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 3);
01154
break
;
01155
01156
case
exif-tag_8h.html#a153a36
EXIF_TAG_BITS_PER_SAMPLE
:
01157                 e->
struct__ExifEntry.html#o2
components
= 3;
01158                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01159                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01160                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01161
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01162
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 8);
01163
exif-utils_8c.html#a4
exif_set_short
(
01164                         e->
struct__ExifEntry.html#o3
data
+
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
),
01165                         o, 8);
01166
exif-utils_8c.html#a4
exif_set_short
(
01167                         e->
struct__ExifEntry.html#o3
data
+ 2 *
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
),
01168                         o, 8);
01169
break
;
01170
case
exif-tag_8h.html#a153a65
EXIF_TAG_YCBCR_SUB_SAMPLING
:
01171                 e->
struct__ExifEntry.html#o2
components
= 2;
01172                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
;
01173                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01174                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01175
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01176
exif-utils_8c.html#a4
exif_set_short
(e->
struct__ExifEntry.html#o3
data
, o, 2);
01177
exif-utils_8c.html#a4
exif_set_short
(
01178                         e->
struct__ExifEntry.html#o3
data
+
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
),
01179                         o, 1);
01180
break
;
01181
01182
/* SRATIONAL, 1 component, no default */
01183
case
exif-tag_8h.html#a153a95
EXIF_TAG_EXPOSURE_BIAS_VALUE
:
01184
case
exif-tag_8h.html#a153a94
EXIF_TAG_BRIGHTNESS_VALUE
:
01185
case
exif-tag_8h.html#a153a92
EXIF_TAG_SHUTTER_SPEED_VALUE
:
01186                 e->
struct__ExifEntry.html#o2
components
= 1;
01187                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a9
EXIF_FORMAT_SRATIONAL
;
01188                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01189                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01190
break
;
01191
01192
/* RATIONAL, 1 component, no default */
01193
case
exif-tag_8h.html#a153a76
EXIF_TAG_EXPOSURE_TIME
:
01194
case
exif-tag_8h.html#a153a117
EXIF_TAG_FOCAL_PLANE_X_RESOLUTION
:
01195
case
exif-tag_8h.html#a153a118
EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION
:
01196
case
exif-tag_8h.html#a153a121
EXIF_TAG_EXPOSURE_INDEX
:
01197
case
exif-tag_8h.html#a153a115
EXIF_TAG_FLASH_ENERGY
:
01198
case
exif-tag_8h.html#a153a77
EXIF_TAG_FNUMBER
:
01199
case
exif-tag_8h.html#a153a101
EXIF_TAG_FOCAL_LENGTH
:
01200
case
exif-tag_8h.html#a153a97
EXIF_TAG_SUBJECT_DISTANCE
:
01201
case
exif-tag_8h.html#a153a96
EXIF_TAG_MAX_APERTURE_VALUE
:
01202
case
exif-tag_8h.html#a153a93
EXIF_TAG_APERTURE_VALUE
:
01203
case
exif-tag_8h.html#a153a91
EXIF_TAG_COMPRESSED_BITS_PER_PIXEL
:
01204
case
exif-tag_8h.html#a153a58
EXIF_TAG_PRIMARY_CHROMATICITIES
:
01205
case
exif-tag_8h.html#a153a129
EXIF_TAG_DIGITAL_ZOOM_RATIO
:
01206                 e->
struct__ExifEntry.html#o2
components
= 1;
01207                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
;
01208                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01209                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01210
break
;
01211
01212
/* RATIONAL, 1 component, default 72/1 */
01213
case
exif-tag_8h.html#a153a49
EXIF_TAG_X_RESOLUTION
:
01214
case
exif-tag_8h.html#a153a50
EXIF_TAG_Y_RESOLUTION
:
01215                 e->
struct__ExifEntry.html#o2
components
= 1;
01216                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
;
01217                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01218                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01219                 r.
structExifRational.html#o0
numerator
= 72;
01220                 r.
structExifRational.html#o1
denominator
= 1;
01221
exif-utils_8c.html#a11
exif_set_rational
(e->
struct__ExifEntry.html#o3
data
, o, r);
01222
break
;
01223
01224
/* RATIONAL, 2 components, no default */
01225
case
exif-tag_8h.html#a153a57
EXIF_TAG_WHITE_POINT
:
01226                 e->
struct__ExifEntry.html#o2
components
= 2;
01227                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
;
01228                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01229                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01230
break
;
01231
01232
/* RATIONAL, 6 components */
01233
case
exif-tag_8h.html#a153a67
EXIF_TAG_REFERENCE_BLACK_WHITE
:
01234                 e->
struct__ExifEntry.html#o2
components
= 6;
01235                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a4
EXIF_FORMAT_RATIONAL
;
01236                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01237                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01238
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01239                 r.
structExifRational.html#o1
denominator
= 1;
01240                 r.
structExifRational.html#o0
numerator
= 0;
01241
exif-utils_8c.html#a11
exif_set_rational
(e->
struct__ExifEntry.html#o3
data
, o, r);
01242                 r.
structExifRational.html#o0
numerator
= 255;
01243
exif-utils_8c.html#a11
exif_set_rational
(
01244                         e->
struct__ExifEntry.html#o3
data
+
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
), o, r);
01245                 r.
structExifRational.html#o0
numerator
= 0;
01246
exif-utils_8c.html#a11
exif_set_rational
(
01247                         e->
struct__ExifEntry.html#o3
data
+ 2 *
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
), o, r);
01248                 r.
structExifRational.html#o0
numerator
= 255;
01249
exif-utils_8c.html#a11
exif_set_rational
(
01250                         e->
struct__ExifEntry.html#o3
data
+ 3 *
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
), o, r);
01251                 r.
structExifRational.html#o0
numerator
= 0;
01252
exif-utils_8c.html#a11
exif_set_rational
(
01253                         e->
struct__ExifEntry.html#o3
data
+ 4 *
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
), o, r);
01254                 r.
structExifRational.html#o0
numerator
= 255;
01255
exif-utils_8c.html#a11
exif_set_rational
(
01256                         e->
struct__ExifEntry.html#o3
data
+ 5 *
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
), o, r);
01257
break
;
01258
01259
/* ASCII, 20 components */
01260
case
exif-tag_8h.html#a153a55
EXIF_TAG_DATE_TIME
:
01261
case
exif-tag_8h.html#a153a88
EXIF_TAG_DATE_TIME_ORIGINAL
:
01262
case
exif-tag_8h.html#a153a89
EXIF_TAG_DATE_TIME_DIGITIZED
:
01263                 t = time (NULL);
01264                 tm = localtime (&t);
01265                 e->
struct__ExifEntry.html#o2
components
= 20;
01266                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
;
01267                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01268                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01269
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01270                 snprintf ((
char
*) e->
struct__ExifEntry.html#o3
data
, e->
struct__ExifEntry.html#o4
size
,
01271
"%04i:%02i:%02i %02i:%02i:%02i"
,
01272                           tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
01273                           tm->tm_hour, tm->tm_min, tm->tm_sec);
01274
break
;
01275
01276
/* ASCII, no default */
01277
case
exif-tag_8h.html#a153a106
EXIF_TAG_SUB_SEC_TIME
:
01278
case
exif-tag_8h.html#a153a107
EXIF_TAG_SUB_SEC_TIME_ORIGINAL
:
01279
case
exif-tag_8h.html#a153a108
EXIF_TAG_SUB_SEC_TIME_DIGITIZED
:
01280                 e->
struct__ExifEntry.html#o2
components
= 0;
01281                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
;
01282                 e->
struct__ExifEntry.html#o4
size
= 0;
01283                 e->
struct__ExifEntry.html#o3
data
= NULL;
01284
break
;
01285
case
exif-tag_8h.html#a153a41
EXIF_TAG_IMAGE_DESCRIPTION
:
01286
case
exif-tag_8h.html#a153a42
EXIF_TAG_MAKE
:
01287
case
exif-tag_8h.html#a153a43
EXIF_TAG_MODEL
:
01288
case
exif-tag_8h.html#a153a54
EXIF_TAG_SOFTWARE
:
01289
case
exif-tag_8h.html#a153a56
EXIF_TAG_ARTIST
:
01290                 e->
struct__ExifEntry.html#o2
components
= strlen (
i18n_8h.html#a6
_
(
"[None]"
)) + 1;
01291                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
;
01292                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01293                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01294
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01295                 strncpy ((
char
*)e->
struct__ExifEntry.html#o3
data
,
i18n_8h.html#a6
_
(
"[None]"
), e->
struct__ExifEntry.html#o4
size
);
01296
break
;
01297
case
exif-tag_8h.html#a153a75
EXIF_TAG_COPYRIGHT
:
01298                 e->
struct__ExifEntry.html#o2
components
= (strlen (
i18n_8h.html#a6
_
(
"[None]"
)) + 1) * 2;
01299                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
;
01300                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01301                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01302
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01303                 strcpy (((
char
*)e->
struct__ExifEntry.html#o3
data
) + 0,
i18n_8h.html#a6
_
(
"[None]"
));
01304                 strcpy (((
char
*)e->
struct__ExifEntry.html#o3
data
) + strlen (
i18n_8h.html#a6
_
(
"[None]"
)) + 1,
i18n_8h.html#a6
_
(
"[None]"
));
01305
break
;
01306
01307
/* UNDEFINED, no components, no default */
01308
case
exif-tag_8h.html#a153a104
EXIF_TAG_MAKER_NOTE
:
01309
case
exif-tag_8h.html#a153a105
EXIF_TAG_USER_COMMENT
:
01310                 e->
struct__ExifEntry.html#o2
components
= 0;
01311                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
01312                 e->
struct__ExifEntry.html#o4
size
= 0;
01313                 e->
struct__ExifEntry.html#o3
data
= NULL;
01314
break
;
01315
01316
/* UNDEFINED, 1 component, default 1 */
01317
case
exif-tag_8h.html#a153a124
EXIF_TAG_SCENE_TYPE
:
01318                 e->
struct__ExifEntry.html#o2
components
= 1;
01319                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
01320                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01321                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01322
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01323                 e->
struct__ExifEntry.html#o3
data
[0] = 0x01;
01324
break
;
01325
01326
/* UNDEFINED, 1 component, default 3 */
01327
case
exif-tag_8h.html#a153a123
EXIF_TAG_FILE_SOURCE
:
01328                 e->
struct__ExifEntry.html#o2
components
= 1;
01329                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
01330                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01331                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01332
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01333                 e->
struct__ExifEntry.html#o3
data
[0] = 0x03;
01334
break
;
01335
01336
/* UNDEFINED, 4 components, default 0 1 0 0 */
01337
case
exif-tag_8h.html#a153a109
EXIF_TAG_FLASH_PIX_VERSION
:
01338                 e->
struct__ExifEntry.html#o2
components
= 4;
01339                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
01340                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01341                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01342
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01343                 memcpy (e->
struct__ExifEntry.html#o3
data
,
"0100"
, 4);
01344
break
;
01345
01346
/* UNDEFINED, 4 components, default 0 2 1 0 */
01347
case
exif-tag_8h.html#a153a87
EXIF_TAG_EXIF_VERSION
:
01348                 e->
struct__ExifEntry.html#o2
components
= 4;
01349                 e->
struct__ExifEntry.html#o1
format
=
exif-format_8h.html#a14a6
EXIF_FORMAT_UNDEFINED
;
01350                 e->
struct__ExifEntry.html#o4
size
=
exif-format_8c.html#a5
exif_format_get_size
(e->
struct__ExifEntry.html#o1
format
) * e->
struct__ExifEntry.html#o2
components
;
01351                 e->
struct__ExifEntry.html#o3
data
=
exif-entry_8c.html#a11
exif_entry_alloc
(e, e->
struct__ExifEntry.html#o4
size
);
01352
if
(!e->
struct__ExifEntry.html#o3
data
)
break
;
01353                 memcpy (e->
struct__ExifEntry.html#o3
data
,
"0210"
, 4);
01354
break
;
01355
01356
default
:
01357
break
;
01358         }
01359 }
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
