On Sun, Jan 15, 2012 at 2:51 PM, Hub Figuière <[email protected]> wrote:
> On 12-01-15 9:19 AM, Klaus Post wrote:
>>
>> Makernotes often contain a lot of useful information, that have not been
>> standardized in EXIF, so I think it would be a significant disadvantage to
>> completely remove it. With what software are you experiencing problems -
>> only flickr? Could you send a sample?
>
>
> And said MakerNote is useless beyond the file generated by the camera.
>
> There might be some non standard fields you want but in that case, the info
> has to me converted and put into the XMP block.
I agree, but as a compromise, the attached patch deletes MakerNotes
*only* if an initial EXIF write fails. This solves my problem, while,
hopefully, not affecting people who want to (and can) keep their
MakerNote data.
As for converting to XMP (or more standarized parts of the EXIF), that
is something exiv2 itself should handle, I think? Or do you want to
implement that in rawstudio?
Regards,
Camilo
Index: librawstudio/rs-exif.cc
===================================================================
--- librawstudio/rs-exif.cc (revision 4102)
+++ librawstudio/rs-exif.cc (working copy)
@@ -199,7 +199,21 @@
image->setExifData(*data);
}
image->setIptcData(iptc_data);
- image->writeMetadata();
+
+ try
+ {
+ image->writeMetadata();
+ }
+ catch (Exiv2::AnyError&)
+ { /* if write fails, header may be too long,
+ try again deleting MakerNotes */
+ Exiv2::ExifData::iterator pos =
+ data->findKey(Exiv2::ExifKey("Exif.Photo.MakerNote"));
+ if (pos != data->end())
+ data->erase(pos);
+ image->setExifData(*data);
+ image->writeMetadata();
+ }
}
catch (Exiv2::AnyError& e)
{
_______________________________________________
Rawstudio-dev mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev