[cairo-commit] src/cairo-png.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 6 12:38:01 PST 2008


 src/cairo-png.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit de515e0f9a46162dcdef3bce81702a56ac6f29bf
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 6 08:10:16 2008 +0000

    [cairo-png] Revert accidental chunk from FORMAT_A1 support.
    
    Whilst splitting the patches, I left in this line which would preserve
    1-bit grayscale unexpanded, but without any of the other FORMAT_A1
    support.

diff --git a/src/cairo-png.c b/src/cairo-png.c
index bdfeda2..6b2ab85 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -465,12 +465,14 @@ read_png (png_rw_ptr	read_func,
         png_set_palette_to_rgb (png);
 
     /* expand gray bit depth if needed */
-    if (color_type == PNG_COLOR_TYPE_GRAY && (depth > 1 && depth < 8))
+    if (color_type == PNG_COLOR_TYPE_GRAY) {
 #if PNG_LIBPNG_VER >= 10209
         png_set_expand_gray_1_2_4_to_8 (png);
 #else
         png_set_gray_1_2_4_to_8 (png);
 #endif
+    }
+
     /* transform transparency to alpha */
     if (png_get_valid (png, info, PNG_INFO_tRNS))
         png_set_tRNS_to_alpha (png);


More information about the cairo-commit mailing list