Commit 02ac849fa for imagemagick.org

commit 02ac849fab759e6653822a84dfec2d5b862d22a2
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Mon Jul 27 17:58:17 2026 +0200

    Only set the TIFFTAG_WEBP_LEVEL when the quality is not undefined.

diff --git a/coders/tiff.c b/coders/tiff.c
index 78dea403f..1f63381e3 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -4030,7 +4030,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
              (photometric == PHOTOMETRIC_MINISBLACK)) &&
             ((bits_per_sample == 8) || (bits_per_sample == 16)))
           predictor=PREDICTOR_HORIZONTAL;
-        (void) TIFFSetField(tiff,TIFFTAG_WEBP_LEVEL,image_info->quality);
+        if (image_info->quality != UndefinedCompressionQuality)
+          (void) TIFFSetField(tiff,TIFFTAG_WEBP_LEVEL,image_info->quality);
         if (image_info->quality >= 100)
           (void) TIFFSetField(tiff,TIFFTAG_WEBP_LOSSLESS,1);
         break;