Author: post
Date: 2011-09-10 11:16:41 +0200 (Sat, 10 Sep 2011)
New Revision: 4028
Modified:
trunk/librawstudio/rs-exif.cc
trunk/librawstudio/rs-exif.h
Log:
Add function to only add EXIF colorspace info.
Modified: trunk/librawstudio/rs-exif.cc
===================================================================
--- trunk/librawstudio/rs-exif.cc 2011-09-10 09:15:48 UTC (rev 4027)
+++ trunk/librawstudio/rs-exif.cc 2011-09-10 09:16:41 UTC (rev 4028)
@@ -328,6 +328,30 @@
}
gboolean
+rs_exif_add_colorspace(const gchar *output_filename, const gchar *color_space,
RSExifFileType type)
+{
+ /* Exiv2 prior to v0.20.0 cannot add tags to TIFF images without
corrupting them */
+ if (RS_EXIF_FILE_TYPE_TIFF == type)
+ if (Exiv2::versionNumber() < 0x1400)
+ return FALSE;
+
+ if (output_filename)
+ {
+ RS_EXIF_DATA *exif;
+ Exiv2::IptcData iptc_data;
+ exif = new Exiv2::ExifData();
+ exif_data_init(exif);
+
+ rs_add_cs_to_exif(exif, color_space);
+
+ rs_exif_add_to_file(exif, iptc_data, output_filename, type);
+ rs_exif_free(exif);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean
rs_exif_copy(const gchar *input_filename, const gchar *output_filename, const
gchar *color_space, RSExifFileType type)
{
/* Exiv2 prior to v0.20.0 cannot add tags to TIFF images without
corrupting them */
Modified: trunk/librawstudio/rs-exif.h
===================================================================
--- trunk/librawstudio/rs-exif.h 2011-09-10 09:15:48 UTC (rev 4027)
+++ trunk/librawstudio/rs-exif.h 2011-09-10 09:16:41 UTC (rev 4028)
@@ -41,6 +41,7 @@
extern RS_EXIF_DATA *rs_exif_load_from_rawfile(RAWFILE *rawfile);
extern void rs_exif_free(RS_EXIF_DATA *d);
extern gboolean rs_exif_copy(const gchar *input_filename, const gchar
*output_filename, const gchar *color_space, RSExifFileType type);
+extern gboolean rs_exif_add_colorspace( const gchar *output_filename, const
gchar *color_space, RSExifFileType type);
#ifdef __cplusplus
}
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit