Author: post
Date: 2010-12-05 23:34:48 +0100 (Sun, 05 Dec 2010)
New Revision: 3669

Modified:
   trunk/librawstudio/rs-exif.cc
Log:
Check Exiv2 version before adding metadata to TIFF images.

Modified: trunk/librawstudio/rs-exif.cc
===================================================================
--- trunk/librawstudio/rs-exif.cc       2010-12-05 19:59:39 UTC (rev 3668)
+++ trunk/librawstudio/rs-exif.cc       2010-12-05 22:34:48 UTC (rev 3669)
@@ -313,6 +313,11 @@
 gboolean
 rs_exif_copy(const gchar *input_filename, const gchar *output_filename, const 
gchar *color_space)
 {
+       /* Exiv2 prior to v0.20.0 cannot add tags to TIFF images without 
corrupting them */
+       if (g_str_has_suffix(output_filename, "tiff") || 
g_str_has_suffix(output_filename, "tif"))
+               if (Exiv2::versionNumber() < 0x1400)
+                       return FALSE;
+
        if (input_filename && output_filename)
        {
                RS_EXIF_DATA *exif;
@@ -326,7 +331,9 @@
                        rs_add_tags_iptc(iptc_data, input_filename, 3);
                rs_exif_add_to_file(exif, iptc_data, output_filename);
                rs_exif_free(exif);
+               return TRUE;
        }
+       return FALSE;
 }
 
 } /* extern "C" */


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to