[gimp] HEIF plug-in: ensure max quality for lossless encoding



commit 6ca6a8d239e8961bfce8f99ef16aa5959de6c2cf
Author: Daniel Novomesky <dnovomesky gmail com>
Date:   Tue Jan 12 12:02:48 2021 +0100

    HEIF plug-in: ensure max quality for lossless encoding
    
    There is a possible bug in libheif. Lossless setting is not working
    when AVIF is saved via rav1e encoder.
    This is a workaround of the problem.

 plug-ins/common/file-heif.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/plug-ins/common/file-heif.c b/plug-ins/common/file-heif.c
index 16f16c4742..4292eec881 100644
--- a/plug-ins/common/file-heif.c
+++ b/plug-ins/common/file-heif.c
@@ -1764,6 +1764,13 @@ save_image (GFile                        *file,
       return FALSE;
     }
 
+  /* workaround for a bug in libheif when heif_encoder_set_lossless is not working
+     (known problem with encoding via rav1e) */
+  if (lossless)
+    {
+      quality = 100;
+    }
+
   heif_encoder_set_lossy_quality (encoder, quality);
   heif_encoder_set_lossless (encoder, lossless);
   /* heif_encoder_set_logging_level (encoder, logging_level); */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]