GraphicsMagick: coders/tga.c: Propagate orientation in TGA writer.

GraphicsMagick Commits <[email protected]> Fri, 23 Feb 2024 17:15:29 -0600
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.9203.1708730142.1744.graphicsmagick-commit@lists.sourceforge.net>
changeset 77c8ec3d293b in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=77c8ec3d293b
summary: coders/tga.c: Propagate orientation in TGA writer.

diffstat:

 ChangeLog    |   4 ++++
 coders/tga.c |  12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 822917870a1a -r 77c8ec3d293b ChangeLog
--- a/ChangeLog	Fri Feb 23 07:34:20 2024 -0600
+++ b/ChangeLog	Sat Feb 24 00:15:07 2024 +0100
@@ -1,3 +1,7 @@
+2024-02-24  Fojtik Jaroslav  <[email protected]>
+
+	* coders/tga.c: Propagate orientation in TGA writer.
+
 2024-02-23  Fojtik Jaroslav  <[email protected]>
 
 	* VisualMagick/configure/configure.rc: Disable static single threaded
diff -r 822917870a1a -r 77c8ec3d293b coders/tga.c
--- a/coders/tga.c	Fri Feb 23 07:34:20 2024 -0600
+++ b/coders/tga.c	Sat Feb 24 00:15:07 2024 +0100
@@ -1,5 +1,5 @@
 /*
-% Copyright (C) 2003 - 2023 GraphicsMagick Group
+% Copyright (C) 2003 - 2024 GraphicsMagick Group
 % Copyright (C) 2002 - 2022 ImageMagick Studio
 % Copyright 1991-1999 E. I. du Pont de Nemours and Company
 %
@@ -25,7 +25,7 @@
 %                                John Cristy                                  %
 %                                 July 1992                                   %
 %                              Jaroslav Fojtik                                %
-%                                   2022                                      %
+%                                 2022-2024                                   %
 %                                                                             %
 %                                                                             %
 %                                                                             %
@@ -1193,6 +1193,14 @@
           tga_info.colormap_size=24;
         }
 
+      switch(image->orientation)
+      {
+        case BottomLeftOrientation:	break;
+        case BottomRightOrientation: tga_info.attributes|=0x10; break;
+        case TopLeftOrientation:     tga_info.attributes|=0x20; break;
+        case TopRightOrientation:    tga_info.attributes|=0x30; break;
+      }
+
       if (image->logging)
         LogTGAInfo(&tga_info);