]> granicus.if.org Git - imagemagick/commitdiff
Set the orientation only once.
authorDirk Lemstra <dirk@lemstra.org>
Sun, 27 Jan 2019 11:13:48 +0000 (12:13 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Sun, 27 Jan 2019 11:16:35 +0000 (12:16 +0100)
coders/tiff.c

index ef33e4cf5cd8505f4ad134aee455be70e8744d19..f5d81b35c266a5fdeb774a980f6c16c329904c18 100644 (file)
@@ -3813,7 +3813,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       default:
         break;
     }
-    (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
     (void) TIFFSetField(tiff,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);
     if (photometric == PHOTOMETRIC_RGB)
       if ((image_info->interlace == PlaneInterlace) ||
@@ -4027,6 +4026,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       }
     if (image->orientation != UndefinedOrientation)
       (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,(uint16) image->orientation);
+    else
+      (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
     TIFFSetProfiles(tiff,image);
     {
       uint16