Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gThumb
Commits
94e1d15c
Commit
94e1d15c
authored
Jul 23, 2010
by
Paolo Bacchilega
Browse files
use the attribute id instead of the metadata id that can be null
parent
d6691717
Changes
2
Hide whitespace changes
Inline
Side-by-side
extensions/exiv2_tools/exiv2-utils.cpp
View file @
94e1d15c
...
...
@@ -611,19 +611,20 @@ mandatory_string (Exiv2::ExifData &checkdata,
const
char
*
gth_main_get_metadata_type
(
GthMetadata
*
metadata
)
gth_main_get_metadata_type
(
GthMetadata
*
metadata
,
const
char
*
attribute
)
{
const
char
*
value_type
;
GthMetadataInfo
*
metadatum_info
;
value_type
=
gth_metadata_get_value_type
(
metadata
);
if
(
g_strcmp0
(
value_type
,
"Undefined"
)
==
0
)
value_type
=
NULL
;
value_type
=
NULL
;
if
(
value_type
!=
NULL
)
return
value_type
;
metadatum_info
=
gth_main_get_metadata_info
(
gth_metadata_get_id
(
metadata
)
);
metadatum_info
=
gth_main_get_metadata_info
(
attribute
);
if
(
metadatum_info
!=
NULL
)
value_type
=
metadatum_info
->
type
;
...
...
@@ -665,7 +666,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image,
*/
const
char
*
raw_value
=
gth_metadata_get_raw
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
,
attributes
[
i
]
);
if
((
raw_value
!=
NULL
)
&&
(
strcmp
(
raw_value
,
""
)
!=
0
)
&&
(
value_type
!=
NULL
))
{
Exiv2
::
Value
::
AutoPtr
value
=
Exiv2
::
Value
::
create
(
Exiv2
::
TypeInfo
::
typeId
(
value_type
));
...
...
@@ -760,7 +761,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image,
try
{
const
char
*
raw_value
=
gth_metadata_get_raw
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
,
attributes
[
i
]
);
if
((
raw_value
!=
NULL
)
&&
(
strcmp
(
raw_value
,
""
)
!=
0
)
&&
(
value_type
!=
NULL
))
{
/* See the exif data code above for an explanation. */
...
...
@@ -796,7 +797,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image,
try
{
const
char
*
raw_value
=
gth_metadata_get_raw
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
);
const
char
*
value_type
=
gth_main_get_metadata_type
(
metadatum
,
attributes
[
i
]
);
if
((
raw_value
!=
NULL
)
&&
(
strcmp
(
raw_value
,
""
)
!=
0
)
&&
(
value_type
!=
NULL
))
{
/* See the exif data code above for an explanation. */
...
...
gthumb/gth-main.c
View file @
94e1d15c
...
...
@@ -581,6 +581,9 @@ gth_main_get_metadata_info (const char *id)
{
int
i
;
if
(
id
==
NULL
)
return
NULL
;
for
(
i
=
0
;
i
<
Main
->
priv
->
metadata_info
->
len
;
i
++
)
{
GthMetadataInfo
*
info
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment