comparison src/exif.c @ 192:d324b284e183

configure --without-exiv2
author nadvornik
date Sat, 22 Mar 2008 17:09:14 +0000
parents 0584cb78aa14
children 77f1bcc6c161
comparison
equal deleted inserted replaced
191:19df9953a5d1 192:d324b284e183
489 489
490 g_free(item->data); 490 g_free(item->data);
491 g_free(item); 491 g_free(item);
492 } 492 }
493 493
494 const char *exif_item_get_tag_name(ExifItem *item) 494 char *exif_item_get_tag_name(ExifItem *item)
495 { 495 {
496 if (!item || !item->marker) return NULL; 496 if (!item || !item->marker) return NULL;
497 return g_strdup(item->marker->key); 497 return g_strdup(item->marker->key);
498 } 498 }
499 499
1320 return NULL; 1320 return NULL;
1321 } 1321 }
1322 1322
1323 #define EXIF_DATA_AS_TEXT_MAX_COUNT 16 1323 #define EXIF_DATA_AS_TEXT_MAX_COUNT 16
1324 1324
1325 gchar *exif_item_get_string(ExifItem *item, int idx)
1326 {
1327 return exif_item_get_data_as_text(item);
1328 }
1329
1330
1325 gchar *exif_item_get_data_as_text(ExifItem *item) 1331 gchar *exif_item_get_data_as_text(ExifItem *item)
1326 { 1332 {
1327 const ExifMarker *marker; 1333 const ExifMarker *marker;
1328 gpointer data; 1334 gpointer data;
1329 GString *string; 1335 GString *string;
1485 break; 1491 break;
1486 } 1492 }
1487 return FALSE; 1493 return FALSE;
1488 } 1494 }
1489 1495
1490 gint exif_get_integer(ExifData *exif, const gchar *key, gint *value)
1491 {
1492 ExifItem *item;
1493
1494 item = exif_get_item(exif, key);
1495 return exif_item_get_integer(item, value);
1496 }
1497 1496
1498 ExifRational *exif_item_get_rational(ExifItem *item, gint *sign) 1497 ExifRational *exif_item_get_rational(ExifItem *item, gint *sign)
1499 { 1498 {
1500 if (!item) return NULL; 1499 if (!item) return NULL;
1501 1500
1507 } 1506 }
1508 1507
1509 return NULL; 1508 return NULL;
1510 } 1509 }
1511 1510
1512 ExifRational *exif_get_rational(ExifData *exif, const gchar *key, gint *sign) 1511
1513 {
1514 ExifItem *item;
1515
1516 item = exif_get_item(exif, key);
1517 return exif_item_get_rational(item, sign);
1518 }
1519
1520
1521 gchar *exif_get_data_as_text(ExifData *exif, const gchar *key)
1522 {
1523 ExifItem *item;
1524 gchar *text;
1525 gint key_valid;
1526
1527 if (!key) return NULL;
1528
1529 text = exif_get_formatted_by_key(exif, key, &key_valid);
1530 if (key_valid) return text;
1531
1532 item = exif_get_item(exif, key);
1533 if (item) return exif_item_get_data_as_text(item);
1534
1535 return NULL;
1536 }
1537 1512
1538 const gchar *exif_get_tag_description_by_key(const gchar *key) 1513 const gchar *exif_get_tag_description_by_key(const gchar *key)
1539 { 1514 {
1540 gint i; 1515 gint i;
1541 1516