From 35e05cb79aabc110c2579643972f8228b1fdd6e4 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 2 Feb 2023 20:39:01 +0100 Subject: [PATCH] Disable LOSSLESS_SUPPORTED checks for libjpeg turbo because they break with their latest code. --- coders/jpeg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coders/jpeg.c b/coders/jpeg.c index b085202033..547cb3fe44 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1278,7 +1278,7 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info, "Scale factor: %.20g",(double) scale_factor); } #if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED) -#if defined(D_LOSSLESS_SUPPORTED) +#if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(D_LOSSLESS_SUPPORTED) image->interlace=jpeg_info->process == JPROC_PROGRESSIVE ? JPEGInterlace : NoInterlace; image->compression=jpeg_info->process == JPROC_LOSSLESS ? @@ -2531,11 +2531,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, } else { -#if !defined(C_LOSSLESS_SUPPORTED) - quality=100; - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: 100"); -#else +#if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(C_LOSSLESS_SUPPORTED) if (image->quality < 100) (void) ThrowMagickException(&image->exception,GetMagickModule(), CoderWarning,"LosslessToLossyJPEGConversion","`%s'",image->filename); @@ -2558,6 +2554,10 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, "Point Transform: %d",point_transform); } } +#else + quality=100; + if (image->debug != MagickFalse) + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: 100"); #endif } option=GetImageOption(image_info,"jpeg:extent");