]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing bounding boxes and test ref file writing.
author= <=>
Wed, 5 Oct 2011 16:18:20 +0000 (09:18 -0700)
committer= <=>
Wed, 5 Oct 2011 16:18:20 +0000 (09:18 -0700)
pdf.js
test/test.py

diff --git a/pdf.js b/pdf.js
index 1aa1f3e60c3d04c5437eaad69ae329e3759e55f3..8cb1a062e2ee769c8a3a2803fd63be0e1caf7221 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -5600,7 +5600,9 @@ var CanvasGraphics = (function canvasGraphics() {
 
       var bbox = stream.dict.get('BBox');
       if (bbox && isArray(bbox) && 4 == bbox.length) {
-        this.rectangle.apply(this, bbox);
+        var width = bbox[2] - bbox[0];
+        var height = bbox[3] - bbox[1];
+        this.rectangle(bbox[0], bbox[1], width, height);
         this.clip();
         this.endPath();
       }
@@ -6355,7 +6357,7 @@ var TilingPattern = (function tilingPattern() {
       graphics.transform.apply(graphics, tmpTranslate);
 
       if (bbox && isArray(bbox) && 4 == bbox.length) {
-        graphics.rectangle.apply(graphics, bbox);
+        graphics.rectangle(bbox[0], bbox[1], width, height);
         graphics.clip();
         graphics.endPath();
       }
index 313a5e03a307ba264c252e25f4ec5761bdea9a7a..1fb2e72c8e9cc6d05d8c525b0efef1f9b725e323 100644 (file)
@@ -435,9 +435,9 @@ def checkEq(task, results, browser, masterMode):
                 # NB: this follows the format of Mozilla reftest
                 # output so that we can reuse its reftest-analyzer
                 # script
-                print >>eqLog, 'REFTEST TEST-UNEXPECTED-FAIL |', browser +'-'+ taskId +'-page'+ str(page + 1), '| image comparison (==)'
-                print >>eqLog, 'REFTEST   IMAGE 1 (TEST):', snapshot
-                print >>eqLog, 'REFTEST   IMAGE 2 (REFERENCE):', ref
+                eqLog.write('REFTEST TEST-UNEXPECTED-FAIL | ' + browser +'-'+ taskId +'-page'+ str(page + 1) + ' | image comparison (==)\n')
+                eqLog.write('REFTEST   IMAGE 1 (TEST): ' + snapshot + '\n')
+                eqLog.write('REFTEST   IMAGE 2 (REFERENCE): ' + ref + '\n')
 
                 passed = False
                 State.numEqFailures += 1
@@ -456,7 +456,8 @@ def checkEq(task, results, browser, masterMode):
 
     if passed:
         print 'TEST-PASS | eq test', task['id'], '| in', browser
-
+    if State.eqLog:
+        State.eqLog.close();
 
 def checkFBF(task, results, browser):
     round0, round1 = results[0], results[1]