[babl] babl: add decrease of bits per components to bad_idea()



commit 0f66bdecfe3418e2b1f8100d53d3ebce00d96462
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Sep 25 20:56:55 2017 +0200

    babl: add decrease of bits per components to bad_idea()
    
    related to bug #787441

 babl/babl-fish-path.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index b7133af..6b2874b 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -165,6 +165,13 @@ bad_idea (const Babl *from, const Babl *to, const Babl *format)
   {
     return 1;
   }
+  if (from->format.type[0]->bits > format->format.type[0]->bits)
+  {
+    /* XXX: perhaps we especially avoid going to half-float, when
+     * going between u16 formats as well? */
+    return 1;
+  }
+
   return 0;
 }
 


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