]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 22 Sep 2018 00:42:05 +0000 (20:42 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 22 Sep 2018 00:42:05 +0000 (20:42 -0400)
coders/tga.c

index ad6a583ffdd4d6ee9aee083944cc50fc8e98ee29..464ab464301f52b48d109c43497ece39b0ad57d8 100644 (file)
@@ -724,7 +724,8 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
     compression;
 
   const char
-    *comment;
+    *comment,
+    *value;
 
   const double
     midpoint = QuantumRange/2.0;
@@ -845,6 +846,19 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
   if ((image->orientation == TopLeftOrientation) ||
       (image->orientation == TopRightOrientation))
     tga_info.attributes|=(1UL << 5);
+  value=GetImageArtifact(image,"tga:image-origin");  /* deprecated */
+  if (value != (const char *) NULL)
+    {
+      OrientationType
+        origin;
+
+      origin=(OrientationType) ParseCommandOption(MagickOrientationOptions,
+        MagickFalse,value);
+      if (origin == BottomRightOrientation || origin == TopRightOrientation)
+        tga_info.attributes|=(1UL << 4);
+      if (origin == TopLeftOrientation || origin == TopRightOrientation)
+        tga_info.attributes|=(1UL << 5);
+    }
   /*
     Write TGA header.
   */