From c9595dd24146229318454c4db276aa534fc8c5f3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 21 Sep 2018 20:42:05 -0400 Subject: [PATCH] ... --- coders/tga.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/coders/tga.c b/coders/tga.c index ad6a583ff..464ab4643 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -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. */ -- 2.40.0