From: Torsten C. <tc...@va...> - 2008-11-07 19:19:15
|
>> (I would have expected a simple double printed though) > > Well, this is what libexif does: it simply prints 3 doubles because > there are 3 values. True ... I meant as a single double. http://www.flickr.com/geoformats.gne But anyway > Hmm, did you read my second mail? Sorry, thought you meant use - not change or copy. > Check what exif_entry_initialize does > for e.g. EXIF_TAG_EXIF_VERSION. You should either > 1) adapt exif_entry_initialize so that it suports also GPS tags > (currently it does not) > 2) copy-past-adapt the code from exif_entry_initialize to your code: For now I just want to get the POC working. But I will provide a patch once it's there. So for now I went with 2) static void set_value(ExifEntry *entry, ExifTag tag, ExifByteOrder order, double value) { entry->tag = tag; entry->components = 3; entry->format = EXIF_FORMAT_RATIONAL; entry->size = exif_format_get_size(entry->format) * entry->components; entry->data = exif_entry_alloc(entry, entry->size); if (!entry->data) return; // dd/1,mm/1,ss/1 dd/1,mmmm/100,0/1 ExifRational value1; value1.numerator = 1; value1.denominator = 1; ExifRational value2; value2.numerator = 1; value2.denominator = 1; ExifRational value3; value3.numerator = 1; value3.denominator = 1; exif_set_rational(entry->data, order, value1); exif_set_rational(entry->data+sizeof(ExifRational), order, value2); exif_set_rational(entry->data+2*sizeof(ExifRational), order, value3); } Still needs the double -> rationals conversion though. Would be nice if libexif would support some of that a little better. Especially with exif_entry_alloc not being available outside. cheers -- Torsten |