[gimp/gimp-2-6] Bug 613328 - TGA files saved with incorrect header yOrigin data



commit 8426f36e5a6cca6963323441c6a56f32a77136b2
Author: Andrew Wyatt <andywyatt onetel com>
Date:   Wed Jul 7 20:38:53 2010 +0200

    Bug 613328 - TGA files saved with incorrect header yOrigin data
    
    Fix header for TGA files saved with save option 'Origin=Top Left'.
    (cherry picked from commit 4a1078796ba2d7b03567760f806ded060bd87e61)

 plug-ins/common/file-tga.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/common/file-tga.c b/plug-ins/common/file-tga.c
index 29ac0d6..0633a77 100644
--- a/plug-ins/common/file-tga.c
+++ b/plug-ins/common/file-tga.c
@@ -1133,7 +1133,7 @@ ReadImage (FILE        *fp,
 }  /*read_image*/
 
 
-static gint
+static gboolean
 save_image (const gchar  *filename,
             gint32        image_ID,
             gint32        drawable_ID,
@@ -1215,8 +1215,10 @@ save_image (const gchar  *filename,
       header[3] = header[4] = header[5] = header[6] = header[7] = 0;
     }
 
-  header[8]  = header[9]  = 0;                          /* xorigin */
-  header[10] = header[11] = tsvals.origin ? 0 : height; /* yorigin */
+  header[8]  = header[9] = 0;                           /* xorigin */
+  header[10] = tsvals.origin ? 0 : (height % 256);      /* yorigin */
+  header[11] = tsvals.origin ? 0 : (height / 256);      /* yorigin */
+
 
   header[12] = width % 256;
   header[13] = width / 256;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]