Commit Graph

1748 Commits

Author SHA1 Message Date
Jonas Jenwald
26bbcedcae Prevent infinite loop when scanning for endstream (bug 1020226) 2014-06-09 22:42:35 +02:00
Yury Delendik
806aa36aa8 Merge pull request #4897 from CodingFabian/optimize-stream-getCode
Optimization for FlateStream_getCode, making more pdfs parsable.
2014-06-09 14:51:42 -05:00
Fabian Lange
22a0e7fe65 Optimization for FlateStream_getCode, making more pdfs parsable.
This commit cleans up the FlateStream_getCode method, and removes a few error
conditions.
Previously it would fail if the codeSize is less than maxLen if end of stream
is reached. However in the document linked below there is a sub-stream
(the one starting at pos 337) which has maxLen set to 11, but actually
contains only 10. After breaking the sanity check still applies, and in this
case passes validating codeSize(10)==codeLen(10).

 http://www.cafeculture.com/wp-content/uploads/2014/03/V-CM-BR-086-04002-1346-0258-GP-Brazil-Fazenda-Cafe-Cambara-Terra-Preta-Microlot-Sample-0460-13-Pulped-Natural-60Kg.pdf
2014-06-09 20:55:31 +02:00
Yury Delendik
9308c7c82f Merge pull request #4896 from CodingFabian/cleanup-jpgjs-buildComponentData
Deleted unused variables in jpgjs buildComponentData.
2014-06-06 09:48:30 -05:00
Fabian Lange
030a188af7 Deleted unused variables in jpgjs buildComponentData. 2014-06-05 16:20:29 +02:00
Fabian Lange
0a42edf82f Optimize JPG.js receiveAndExtend for 1 bit case.
Profiling showed that receiveAndExtend is frequently called with the length of
one bit. This happens for example in decodeBaseline.
For a single bit, the loop and shift in receive, as well as the shifts in
receiveAndExtend are overhead.
This shortcut manually calculates the shifts by either returning 1 or -1 from
receiveAndExtend by reading the bit and deciding on the return value.
While it comes with an overhead for each non-one length, the speedup is at about
10% in the hot parse/decode path.
2014-06-05 12:24:53 +02:00
Yury Delendik
43a103d5d3 Merge pull request #4889 from CodingFabian/optimize-jpg-loops
Optimized loops in JPG conversion.
2014-06-04 15:34:48 -05:00
Yury Delendik
11c12464e3 Merge pull request #4891 from yurydelendik/typo
Fixes typo in getAsync
2014-06-04 13:19:16 -05:00
Yury Delendik
b20b404061 Fixes typo in getAsync 2014-06-04 11:30:53 -05:00
Fabian Lange
dcde59fa76 Optimized loops in JPG conversion.
This change makes the 4 conversion loops look the same.
It optimizes access of the array length and access of the property
numComponents, which is known to be constant.
2014-06-04 10:02:47 +02:00
Yury Delendik
6235e3a61c Adds color components decoding to the JPEG 2014-06-03 08:51:57 -05:00
Yury Delendik
2449142fc3 Merge pull request #4835 from Snuffleupagus/issue-4800
Prevent font error when no preferred cmap table is found (workaround for issue 4800)
2014-06-02 14:42:58 -05:00
Yury Delendik
3acf5709a0 Merge pull request #4876 from Snuffleupagus/issue-4875
Prevent adding undefined array entries to CMap.map in mapRangeToArray (issue 4875)
2014-06-02 14:31:20 -05:00
Yury Delendik
5ded0ea163 Merge pull request #4866 from yurydelendik/issue4673
Removes mozResponseArrayBuffer
2014-06-02 12:51:29 -05:00
Jonas Jenwald
d1c71ab7ad Prevent adding undefined array entries to CMap.map in mapRangeToArray (issue 4875) 2014-06-02 14:29:54 +02:00
Yury Delendik
9c87fa24f7 Removes mozResponseArrayBuffer 2014-05-29 20:38:50 -05:00
Mohammed Abu-alsaad
e6546642db Added more preference variables from the available hash parameters 2014-05-30 10:44:41 +12:00
Yury Delendik
844bc644fb Merge pull request #4861 from timvandermeij/xobject
Fixes unhandled XObject subtype PS error
2014-05-29 08:40:57 -05:00
Jonas Jenwald
7e6cdc74af Merge pull request #4832 from yurydelendik/showtext
Refactors showText: split type3, remove showSpacedText
2014-05-29 12:58:09 +02:00
Tim van der Meij
e128bdc397 Fixes unhandled XObject subtype PS error 2014-05-29 11:53:13 +02:00
Jonas Jenwald
3c5dedf60d Prevent font error when no preferred cmap table is found (workaround for issue 4800) 2014-05-27 17:30:11 +02:00
koderok
81d3f4a89b merged with earlier commits 2014-05-24 05:37:25 +05:30
Yury Delendik
f000c04b73 Merge pull request #4829 from fkaelberer/optimize_parser_getObj
small optimizations in parser.getObj(), lexer.getObj()
2014-05-23 15:14:18 -05:00
Jonas Jenwald
002607502c Merge pull request #4824 from yurydelendik/movecs
Moves colorspace.js and function.js into core/
2014-05-23 21:14:58 +02:00
Yury Delendik
fcc4dfd9b5 Moves shared/function.js to core/ 2014-05-23 14:11:47 -05:00
Yury Delendik
7a19085159 Moves shared/colorspace.js into core/ 2014-05-23 14:11:47 -05:00
Yury Delendik
542c9c4c7a Moves ColorSpace logic into evaluator 2014-05-23 14:11:47 -05:00
Yury Delendik
d53dc2e7d6 Refactors showText: split type3, remove showSpacedText 2014-05-23 13:36:54 -05:00
fkaelberer
f88118dbf9 small optimizations in parser.getObj(), lexer.getObj() 2014-05-23 09:25:36 +02:00
Samuel Chantaraud
37c3641fad Added Promise.catch
Fixed Promise so it rejects on uncaught exception
Catch possible rejection on ViewHistory.setMultiple
2014-05-22 13:53:19 -04:00
Yury Delendik
f4baea900e Fixes regression in the cleanup 2014-05-20 21:57:04 -05:00
Jonas Jenwald
fe27a76004 Merge pull request #4815 from yurydelendik/loadFont
Refactors loadFont for translateFont be async
2014-05-20 21:30:42 +02:00
p01
455c6b2d35 Removed several 'in' operators in canvas.js
This gives up to 6x speed improvement on these methods
2014-05-20 12:39:59 +02:00
p01
cf5ff3d327 Fewer lookups in CanvasGraphics_constructPath 2014-05-20 12:39:58 +02:00
p01
7b68737baa Strict isEOF / ~22% faster on issue2813, from 16.5s to 13.5s 2014-05-20 12:39:58 +02:00
Yury Delendik
e5a0d89da9 Refactors loadFont for translateFont be async; fixes type3 dup data 2014-05-19 16:27:54 -05:00
Jonas Jenwald
7079992d89 Merge pull request #4770 from yurydelendik/promise-operationlist
Adds Promises to getOperatorList
2014-05-19 23:22:40 +02:00
Yury Delendik
88aa396aca Terminate getOperationList and getTextContent every 20 ms 2014-05-19 16:19:54 -05:00
Yury Delendik
d8eb8b1de1 Adds Promise to the getOperatorList 2014-05-19 16:19:54 -05:00
Yury Delendik
5cd6483ebb Merge pull request #4809 from Snuffleupagus/bug-866395-redux
Fix loading of fonts with empty font files (bug 866395 and issue 3522)
2014-05-19 11:23:54 -05:00
Jonas Jenwald
a984fe5b55 Add more unit tests for the API 2014-05-18 23:35:29 +02:00
Jonas Jenwald
3e1db41ddd Fix loading of fonts with empty font files (bug 866395 and issue 3522) 2014-05-18 21:41:06 +02:00
Jonas Jenwald
ea0453f106 Add isEmpty method to Stream, DecodeStream and ChunkedStream 2014-05-18 21:41:05 +02:00
Yury Delendik
c0419d7dea Merge pull request #4773 from fkaelberer/shorterDecodeInt
Simplify Jbig2Image.decodeInteger()
2014-05-18 08:46:08 -05:00
Christian Krebs
3e7bcaa892 Handle nested post script arguments in the preprocessor
Fix for issue #4785
2014-05-15 19:49:43 +02:00
p01
330b99f428 Optimized stream.js / 9-10x faster DecodeStream_ensureBuffer 2014-05-14 17:06:39 +02:00
p01
8cfd024e48 Optimized colorspace.js AlternateCS_getRgbBuffer 2014-05-14 17:06:39 +02:00
p01
95fda4fcdc Optimized function.js / 2x Faster PDFFunction_constructPostScriptFromIR 2014-05-14 17:06:38 +02:00
Yury Delendik
048c6d99f1 Merge pull request #4736 from Snuffleupagus/glyph-accent-buildPath
Build paths for glyph accents when drawing text as curves
2014-05-14 07:40:50 -05:00
Jonas Jenwald
c68ffcf978 Check if the Names dictionary actually contains a Dests dictionary before attempting to get the destinations 2014-05-14 12:43:20 +02:00