Author: post
Date: 2010-12-06 23:00:19 +0100 (Mon, 06 Dec 2010)
New Revision: 3673

Modified:
   trunk/librawstudio/rs-exif.cc
Log:
Check if EXIF data has been read before writing.

Modified: trunk/librawstudio/rs-exif.cc
===================================================================
--- trunk/librawstudio/rs-exif.cc       2010-12-06 05:12:10 UTC (rev 3672)
+++ trunk/librawstudio/rs-exif.cc       2010-12-06 22:00:19 UTC (rev 3673)
@@ -136,6 +136,7 @@
        }
        catch (Exiv2::AnyError& e)
        {
+               g_warning("Could not load EXIF data from file %s", filename);
                return NULL;
        }
 
@@ -160,6 +161,7 @@
        }
        catch (Exiv2::AnyError& e)
        {
+               g_warning("Could not load EXIF data");
                return NULL;
        }
 
@@ -221,6 +223,8 @@
 static void 
 rs_add_tags_exif(RS_EXIF_DATA *d, const gchar *input_filename)
 {
+       if (!d)
+               return;
        Exiv2::ExifData *data = (Exiv2::ExifData *) d;
        RSLibrary *lib = rs_library_get_singleton();
        GList *tags = rs_library_photo_tags(lib, input_filename, FALSE);
@@ -323,6 +327,8 @@
                RS_EXIF_DATA *exif;
                Exiv2::IptcData iptc_data;
                exif = rs_exif_load_from_file(input_filename);
+               if (NULL == exif)
+                       return FALSE;
                rs_add_cs_to_exif(exif, color_space);
                rs_add_tags_exif(exif, input_filename);
                if (g_str_has_suffix(output_filename, "jpg"))


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

Reply via email to