Update of /cvsroot/ufraw/ufraw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15529

Modified Files:
        ufraw_writer.c 
Log Message:
Fix writing of black'n'white PPM files.

Index: ufraw_writer.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_writer.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- ufraw_writer.c      29 Sep 2009 01:03:11 -0000      1.63
+++ ufraw_writer.c      4 Oct 2009 14:30:14 -0000       1.64
@@ -67,20 +67,21 @@
 {
     (void)row;
     int rowStride = width * (grayscale ? 1 : 3) * (bitDepth>8 ? 2 : 1);
+    int i;
     if ( bitDepth>8 ) {
        guint16 *pixbuf16 = (guint16 *)pixbuf;
-       int i;
        for (i=0; i<3*width*height; i++)
            pixbuf16[i] = g_htons(pixbuf16[i]);
     }
-    if ((int)fwrite(pixbuf, rowStride, height, out)<height) {
-       ufraw_set_error(uf, _("Error creating file '%s'."),
-        uf->conf->outputFilename);
-       ufraw_set_error(uf, g_strerror(errno));
-       return UFRAW_ERROR;
-    } else {
-       return UFRAW_SUCCESS;
+    for (i=0; i<height; i++) {
+       if ((int)fwrite(pixbuf+i*width*(bitDepth>8?6:3), rowStride, 1, out)<1) {
+           ufraw_set_error(uf, _("Error creating file '%s'."),
+            uf->conf->outputFilename);
+           ufraw_set_error(uf, g_strerror(errno));
+           return UFRAW_ERROR;
+       }
     }
+    return UFRAW_SUCCESS;
 }
 
 #ifdef HAVE_LIBTIFF


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to