[Rawstudio-commit] r1979 - trunk/src

Anders Brander anders at brander.dk
Wed Sep 3 19:16:49 CEST 2008


Author: abrander
Date: 2008-09-03 19:16:49 +0200 (Wed, 03 Sep 2008)
New Revision: 1979

Modified:
   trunk/src/Makefile.am
   trunk/src/rawstudio.c
   trunk/src/rs-tiff.c
   trunk/src/toolbox.c
Log:
[173] Fixed saving of TIFF-files with embedded profiles.

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2008-09-03 16:22:59 UTC (rev 1978)
+++ trunk/src/Makefile.am	2008-09-03 17:16:49 UTC (rev 1979)
@@ -7,7 +7,7 @@
 
 AM_CFLAGS =\
 	-Wall\
-	-O4\
+	-g3\
 	-DWITH_GCONF\
 	-DDCRAW_NOMAIN\
 	-DDCRAW_NOLCMS\
@@ -18,8 +18,11 @@
 uidir = $(datadir)/rawstudio/
 ui_DATA = ui.xml rawstudio.gtkrc
 
-bin_PROGRAMS = rawstudio
+bin_PROGRAMS = rawstudio cr2test
 
+cr2test_SOURCES = rawfile.c rawfile.h cr2test.c cr2jpeg.c cr2jpeg.h
+cr2test_LDADD = @PACKAGE_LIBS@ @LIBJPEG@ @LIBTIFF@ $(INTLLIBS)
+
 EXTRA_DIST = \
 	$(ui_DATA)
 

Modified: trunk/src/rawstudio.c
===================================================================
--- trunk/src/rawstudio.c	2008-09-03 16:22:59 UTC (rev 1978)
+++ trunk/src/rawstudio.c	2008-09-03 17:16:49 UTC (rev 1979)
@@ -598,6 +598,7 @@
 			rs_conf_get_boolean(CONF_EXPORT_TIFF_UNCOMPRESSED, &uncompressed_tiff);
 			rs_color_transform_transform(rct, rsi->w, rsi->h, rsi->pixels,
 				rsi->rowstride, gdk_pixbuf_get_pixels(pixbuf), gdk_pixbuf_get_rowstride(pixbuf));
+			printf("rs_photo_save() filename: %s\n", rs_cms_get_profile_filename(cms, CMS_PROFILE_EXPORT));
 			rs_tiff8_save(pixbuf, filename, rs_cms_get_profile_filename(cms, CMS_PROFILE_EXPORT), uncompressed_tiff);
 			g_object_unref(pixbuf);
 			break;

Modified: trunk/src/rs-tiff.c
===================================================================
--- trunk/src/rs-tiff.c	2008-09-03 16:22:59 UTC (rev 1978)
+++ trunk/src/rs-tiff.c	2008-09-03 17:16:49 UTC (rev 1979)
@@ -48,19 +48,13 @@
 	}
 	if (profile_filename)
 	{
-		struct stat st;
-		guchar *buffer;
-		gint fd;
-		stat(profile_filename, &st);
-		if (st.st_size>0)
-			if ((fd = open(profile_filename, O_RDONLY)) != -1)
-			{
-				buffer = g_malloc(st.st_size);
-				if (read(fd, &buffer, st.st_size) == st.st_size)
-					TIFFSetField(output, TIFFTAG_ICCPROFILE, st.st_size, buffer);
-				g_free(buffer);
-				close(fd);
-			}
+		gchar *buffer = NULL;
+		gsize length = 0;
+
+		if (g_file_get_contents(profile_filename, &buffer, &length, NULL))
+			TIFFSetField(output, TIFFTAG_ICCPROFILE, length, buffer);
+
+		g_free(buffer);
 	}
 	TIFFSetField(output, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(output, 0));
 }

Modified: trunk/src/toolbox.c
===================================================================
--- trunk/src/toolbox.c	2008-09-03 16:22:59 UTC (rev 1978)
+++ trunk/src/toolbox.c	2008-09-03 17:16:49 UTC (rev 1979)
@@ -357,6 +357,7 @@
 static void
 gui_notebook_callback(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, RS_BLOB *rs)
 {
+	printf("gui_notebook_callback\n");
 	rs_set_snapshot(rs, page_num);
 }
 




More information about the Rawstudio-commit mailing list