Commit 1269cf551 for imagemagick.org

commit 1269cf551360bcb29cb3e1899c129c41fa7a9838
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Sat Dec 6 14:34:24 2025 +0100

    Check for quality instead of compression to avoid Unsupported JPEG data precision error message (#8445).

diff --git a/coders/jpeg.c b/coders/jpeg.c
index 76c0e8c99..6eeeda180 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -2483,7 +2483,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
   if (IsStringTrue(option) != MagickFalse)
     {
 #if defined(C_LOSSLESS_SUPPORTED)
-      if (image_info->compression == LosslessJPEGCompression)
+      if (image->quality == 100)
         {
 #if defined(LIBJPEG_TURBO_VERSION_NUMBER) && LIBJPEG_TURBO_VERSION_NUMBER >= 3000090
           jpeg_info->data_precision=(int) image->depth;