[gimp/gimp-2-10] Issue #3193: Wrong colors after exporting 8bpc RGB png from 32f...



commit 3ee3ca9c71833ed7a62923fd5af74d2d9968b082
Author: Jehan <jehan girinstud io>
Date:   Fri Apr 12 14:33:19 2019 +0200

    Issue #3193: Wrong colors after exporting 8bpc RGB png from 32f...
    
    ... linear XCF.
    When choosing a specific pixel format (other than "Automatic"), we
    always export as non-linear. Therefore if we were going to save a linear
    profile, make sure we also convert it to sRGB too.
    
    (cherry picked from commit c5fae74ac1c70eb4789e7aaacd4d216b74878b78)

 plug-ins/common/file-png.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index cc0eba29c1..003f24ae7c 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -1739,6 +1739,14 @@ save_image (const gchar  *filename,
           bit_depth = 16;
           break;
       }
+      if (linear && profile)
+        {
+          GimpColorProfile *saved_profile;
+
+          saved_profile = gimp_color_profile_new_srgb_trc_from_color_profile (profile);
+          g_object_unref (profile);
+          profile = saved_profile;
+        }
     }
 
   bpp = babl_format_get_bytes_per_pixel (file_format);


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