[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-poppler
Subject:    [poppler] poppler/Gfx.cc
From:       aacid () kemper ! freedesktop ! org (Albert Astals Cid)
Date:       2009-11-21 1:43:52
Message-ID: 20091121014352.BD31C10051 () kemper ! freedesktop ! org
[Download RAW message or body]

 poppler/Gfx.cc |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b905caf1785ee207cc0480953da69be302d3d4e9
Author: David Benjamin <davidben@mit.edu>
Date:   Sat Nov 21 02:43:21 2009 +0100

    Be more lenient with /Decode key on images
    
    The spec requires the field be [1 0] or [0 1]. Adobe accepts floating point
    values as well. This fixes bug #17439.

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index eeabd87..2a4c9b8 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -30,6 +30,7 @@
 // Copyright (C) 2009 M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
 // Copyright (C) 2009 William Bader <williambader@hotmail.com>
+// Copyright (C) 2009 David Benjamin <davidben@mit.edu>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -3875,7 +3876,9 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
     }
     if (obj1.isArray()) {
       obj1.arrayGet(0, &obj2);
-      if (obj2.isInt() && obj2.getInt() == 1)
+      // Table 4.39 says /Decode must be [1 0] or [0 1]. Adobe
+      // accepts [1.0 0.0] as well.
+      if (obj2.isNum() && obj2.getNum() >= 0.9)
 	invert = gTrue;
       obj2.free();
     } else if (!obj1.isNull()) {
@@ -4097,7 +4100,9 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
       }
       if (obj1.isArray()) {
 	obj1.arrayGet(0, &obj2);
-	if (obj2.isInt() && obj2.getInt() == 1) {
+	// Table 4.39 says /Decode must be [1 0] or [0 1]. Adobe
+	// accepts [1.0 0.0] as well.
+	if (obj2.isNum() && obj2.getNum() >= 0.9) {
 	  maskInvert = gTrue;
 	}
 	obj2.free();
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic