comparison src/exiv2.cc @ 414:49c1cbe058ae

partially fixed reading embedded color profiles with exiv2
author nadvornik
date Fri, 18 Apr 2008 22:31:58 +0000
parents 0fc0a130e8cf
children 115db540bd0c
comparison
equal deleted inserted replaced
413:9e521adbf312 414:49c1cbe058ae
314 } 314 }
315 } 315 }
316 316
317 char *exif_item_get_data(ExifItem *item, guint *data_len) 317 char *exif_item_get_data(ExifItem *item, guint *data_len)
318 { 318 {
319 return NULL; 319 try {
320 if (!item) return 0;
321 Exiv2::Metadatum *md = (Exiv2::Metadatum *)item;
322 if(data_len) *data_len = md->size();
323 char *data = (char *)g_malloc(md->size());
324 long res = md->copy((Exiv2::byte *)data, Exiv2::littleEndian /* should not matter */);
325 g_assert(res == md->size());
326 return data;
327 }
328 catch (Exiv2::AnyError& e) {
329 std::cout << "Caught Exiv2 exception '" << e << "'\n";
330 return NULL;
331 }
320 } 332 }
321 333
322 char *exif_item_get_description(ExifItem *item) 334 char *exif_item_get_description(ExifItem *item)
323 { 335 {
324 try { 336 try {