[Pkg-javascript-commits] [pdf.js] 73/414: shading-pattern: Decreased `Shadings.SMALL_NUMBER` and added a test case for #6298

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 90ec2c9294409b19b983c1988f89bc5f385d108d
Author: Daan Sprenkels <dsprenkels at gmail.com>
Date:   Wed Dec 23 18:17:23 2015 +0100

    shading-pattern: Decreased `Shadings.SMALL_NUMBER`
    and added a test case for #6298
---
 src/core/pattern.js     |   6 +-
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue6298.pdf | 159 ++++++++++++++++++++++++++++++++++++++++++++++++
 test/test_manifest.json |   6 ++
 4 files changed, 168 insertions(+), 4 deletions(-)

diff --git a/src/core/pattern.js b/src/core/pattern.js
index 589443e..2f5c4bd 100644
--- a/src/core/pattern.js
+++ b/src/core/pattern.js
@@ -102,10 +102,8 @@ var Pattern = (function PatternClosure() {
 var Shadings = {};
 
 // A small number to offset the first/last color stops so we can insert ones to
-// support extend.  Number.MIN_VALUE appears to be too small and breaks the
-// extend. 1e-7 works in FF but chrome seems to use an even smaller sized number
-// internally so we have to go bigger.
-Shadings.SMALL_NUMBER = 1e-2;
+// support extend. Number.MIN_VALUE is too small and breaks the extend.
+Shadings.SMALL_NUMBER = 1e-6;
 
 // Radial and axial shading have very similar implementations
 // If needed, the implementations can be broken into two classes
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 74aa953..fea8827 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -197,6 +197,7 @@
 !issue6069.pdf
 !issue6106.pdf
 !issue6296.pdf
+!issue6298.pdf
 !bug1001080.pdf
 !issue6108.pdf
 !issue6113.pdf
diff --git a/test/pdfs/issue6298.pdf b/test/pdfs/issue6298.pdf
new file mode 100644
index 0000000..edc1168
--- /dev/null
+++ b/test/pdfs/issue6298.pdf
@@ -0,0 +1,159 @@
+%PDF-1.4
+%����
+1 0 obj 
+<<
+/Metadata 2 0 R
+/Type /Catalog
+/Pages 3 0 R
+>>
+endobj 
+3 0 obj 
+<<
+/Kids [4 0 R]
+/Type /Pages
+/Count 1
+>>
+endobj 
+4 0 obj 
+<<
+/Resources 
+<<
+/ProcSet [/PDF]
+/Shading 5 0 R
+/ExtGState 6 0 R
+/ColorSpace 7 0 R
+/Pattern 8 0 R
+>>
+/Contents 9 0 R
+/Parent 3 0 R
+/Type /Page
+/MediaBox [0 0 1000 100]
+>>
+endobj 
+9 0 obj 
+<<
+/Length 43
+>>
+stream
+/R7 gs
+/R8 cs
+/R9 scn
+0 0 1000 1000 re
+f
+Q
+
+endstream 
+endobj 
+10 0 obj 
+<<
+/OPM 1
+/Type /ExtGState
+>>
+endobj 
+11 0 obj [/Pattern]
+endobj 
+12 0 obj 
+<<
+/PatternType 2
+/Shading 13 0 R
+/Matrix [1 0 0 1 0 0]
+>>
+endobj 
+13 0 obj 
+<<
+/Coords [0 0 1000 0]
+/Extend [false false]
+/Function 14 0 R
+/ShadingType 2
+/ColorSpace /DeviceRGB
+>>
+endobj 
+14 0 obj 
+<<
+/N 1
+/FunctionType 2
+/C1 [0 1 0]
+/C0 [0 0 1]
+/Domain [0 1]
+>>
+endobj 
+7 0 obj 
+<<
+/R8 11 0 R
+>>
+endobj 
+6 0 obj 
+<<
+/R7 10 0 R
+>>
+endobj 
+8 0 obj 
+<<
+/R9 12 0 R
+>>
+endobj 
+5 0 obj 
+<<
+/R10 13 0 R
+>>
+endobj 
+2 0 obj 
+<<
+/Subtype /XML
+/Type /Metadata
+/Length 1340
+>>
+stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about='uuid:b3731086-cb9c-11f0-0000-d82b517c3e1c' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.10'/>
+<rdf:Description rdf:about='uuid:b3731086-cb9c-11f0-0000-d82b517c3e1c' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2015-11-25T15:23:52+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2015-11-25T15:23:52+01:00</xmp:CreateDate>
+<xmp:CreatorTool>Asymptote 2.15</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about='uuid:b3731086-cb9c-11f0-0000-d82b517c3e1c' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:b3731086-cb9c-11f0-0000-d82b517c3e1c'/>
+<rdf:Description rdf:about='uuid:b3731086-cb9c-11f0-0000-d82b517c3e1c' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+                                                                        
+                                                                        
+<?xpacket end='w'?>
+endstream 
+endobj 
+15 0 obj 
+<<
+/ModDate (D:20151125152352+01'00')
+/CreationDate (D:20151125152352+01'00')
+/Creator (Asymptote 2.15)
+/Producer (GPL Ghostscript 9.10)
+>>
+endobj xref
+0 16
+0000000000 65535 f 
+0000000015 00000 n 
+0000000921 00000 n 
+0000000082 00000 n 
+0000000141 00000 n 
+0000000886 00000 n 
+0000000818 00000 n 
+0000000784 00000 n 
+0000000852 00000 n 
+0000000330 00000 n 
+0000000426 00000 n 
+0000000474 00000 n 
+0000000502 00000 n 
+0000000579 00000 n 
+0000000701 00000 n 
+0000002346 00000 n 
+trailer
+
+<<
+/Info 15 0 R
+/ID [<00343308f37198793d00d83bd9194491> <00343308f37198793d00d83bd9194491>]
+/Root 1 0 R
+/Size 16
+>>
+startxref
+2503
+%%EOF
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 6945092..4ebf23c 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -2597,6 +2597,12 @@
        "rounds": 1,
        "type": "eq"
     },
+    {  "id": "issue6298.pdf",
+       "file": "pdfs/issue6298.pdf",
+       "md5": "214340be34f463611fc3127ad0695034",
+       "rounds": 1,
+       "type": "eq"
+    },
     {  "id": "issue5549.pdf",
        "file": "pdfs/issue5549.pdf",
        "md5": "6c36df6ebc583c9e18aad0ad00d257b8",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list