Commit cc11285e57c07df34e5c7e2aa41100e22d3a128e
1 parent
2532db57
Deprecate QPDFObjectHandle::parse overload and undeprecate isInitialized
Showing
4 changed files
with
20 additions
and
12 deletions
TODO.md
| @@ -463,10 +463,10 @@ so, I find it useful to make reference to them in this list. | @@ -463,10 +463,10 @@ so, I find it useful to make reference to them in this list. | ||
| 463 | which includes machine-readable dump of table D.2 in the ISO-32000 PDF spec. This shows the | 463 | which includes machine-readable dump of table D.2 in the ISO-32000 PDF spec. This shows the |
| 464 | mapping between Unicode, StandardEncoding, WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding. | 464 | mapping between Unicode, StandardEncoding, WinAnsiEncoding, MacRomanEncoding, and PDFDocEncoding. |
| 465 | 465 | ||
| 466 | -* Some test cases on bad files fail because qpdf is unable to find the root dictionary when it fails | ||
| 467 | - to read the trailer. Recovery could find the root dictionary and even the info dictionary in other | ||
| 468 | - ways. In particular, issue-202.pdf can be opened by evince, and there's no real reason that qpdf | ||
| 469 | - couldn't be made to be able to recover that file as well. | 466 | +* Some test cases on bad files failed because qpdf was unable to find the root dictionary when it |
| 467 | + failed to read the trailer. Ths was fixed in https://github.com/qpdf/qpdf/pull/1343 . A similar | ||
| 468 | + issue with a similar solution exists for failure to find the pages tree | ||
| 469 | + (see https://github.com/qpdf/qpdf/issues/1362). | ||
| 470 | 470 | ||
| 471 | * Audit every place where qpdf allocates memory to see whether there are cases where malicious | 471 | * Audit every place where qpdf allocates memory to see whether there are cases where malicious |
| 472 | inputs could cause qpdf to attempt to grab very large amounts of memory. Certainly there are cases | 472 | inputs could cause qpdf to attempt to grab very large amounts of memory. Certainly there are cases |
| @@ -499,10 +499,10 @@ so, I find it useful to make reference to them in this list. | @@ -499,10 +499,10 @@ so, I find it useful to make reference to them in this list. | ||
| 499 | ../misc/digital-signatures/digitally-signed-pdf-xfa.pdf. If digital signatures are implemented, | 499 | ../misc/digital-signatures/digitally-signed-pdf-xfa.pdf. If digital signatures are implemented, |
| 500 | update the docs on crypto providers, which mention that this may happen in the future. | 500 | update the docs on crypto providers, which mention that this may happen in the future. |
| 501 | 501 | ||
| 502 | -* Qpdf does not honor /EFF when adding new file attachments. When it encrypts, it never generates | 502 | +* qpdf does not honor /EFF when adding new file attachments. When it encrypts, it never generates |
| 503 | streams with explicit crypt filters. Prior to 10.2, there was an incorrect attempt to treat /EFF | 503 | streams with explicit crypt filters. Prior to 10.2, there was an incorrect attempt to treat /EFF |
| 504 | as a default value for decrypting file attachment streams, but it is not supposed to mean that. | 504 | as a default value for decrypting file attachment streams, but it is not supposed to mean that. |
| 505 | - Instead, it is intended for conforming writers to obey this when adding new attachments. Qpdf is | 505 | + Instead, it is intended for conforming writers to obey this when adding new attachments. qpdf is |
| 506 | not a conforming writer in that respect. | 506 | not a conforming writer in that respect. |
| 507 | 507 | ||
| 508 | * The whole xref handling code in the QPDF object allows the same object with more than one | 508 | * The whole xref handling code in the QPDF object allows the same object with more than one |
| @@ -533,6 +533,10 @@ so, I find it useful to make reference to them in this list. | @@ -533,6 +533,10 @@ so, I find it useful to make reference to them in this list. | ||
| 533 | * Look at places in the code where object traversal is being done and, where possible, try to avoid | 533 | * Look at places in the code where object traversal is being done and, where possible, try to avoid |
| 534 | it entirely or at least avoid ever traversing the same objects multiple times. | 534 | it entirely or at least avoid ever traversing the same objects multiple times. |
| 535 | 535 | ||
| 536 | +* The CLI warants a thorough review, including the introduction of proper sub-commands. Add warnings | ||
| 537 | + for file names without extension or path element as first parameter | ||
| 538 | + (see https://github.com/qpdf/qpdf/pull/1381). | ||
| 539 | + | ||
| 536 | ---------------------------------------------------------------------- | 540 | ---------------------------------------------------------------------- |
| 537 | 541 | ||
| 538 | ### HISTORICAL NOTES | 542 | ### HISTORICAL NOTES |
| @@ -548,7 +552,7 @@ As described in https://github.com/qpdf/qpdf/issues/401, there was great perform | @@ -548,7 +552,7 @@ As described in https://github.com/qpdf/qpdf/issues/401, there was great perform | ||
| 548 | between qpdf 7.1.1 and 9.1.1. Doing a bisect between dac65a21fb4fa5f871e31c314280b75adde89a6c and | 552 | between qpdf 7.1.1 and 9.1.1. Doing a bisect between dac65a21fb4fa5f871e31c314280b75adde89a6c and |
| 549 | release-qpdf-7.1.1, I found several commits that damaged performance. I fixed some of them to | 553 | release-qpdf-7.1.1, I found several commits that damaged performance. I fixed some of them to |
| 550 | improve performance by about 70% (as measured by saying that old times were 170% of new times). The | 554 | improve performance by about 70% (as measured by saying that old times were 170% of new times). The |
| 551 | -remaining commits that broke performance either can't be correct because they would re-introduce an | 555 | +remaining commits that broke performance either can't be corrected because they would re-introduce an |
| 552 | old bug or aren't worth correcting because of the high value they offer relative to a relatively low | 556 | old bug or aren't worth correcting because of the high value they offer relative to a relatively low |
| 553 | penalty. For historical reference, here are the commits. The numbers are the time in seconds on the | 557 | penalty. For historical reference, here are the commits. The numbers are the time in seconds on the |
| 554 | machine I happened to be using of splitting the first 100 pages of PDF32000_2008.pdf 20 times and | 558 | machine I happened to be using of splitting the first 100 pages of PDF32000_2008.pdf 20 times and |
include/qpdf/QPDFObjectHandle.hh
| @@ -288,7 +288,9 @@ class QPDFObjectHandle: public qpdf::BaseHandle | @@ -288,7 +288,9 @@ class QPDFObjectHandle: public qpdf::BaseHandle | ||
| 288 | QPDFObjectHandle(QPDFObjectHandle&&) = default; | 288 | QPDFObjectHandle(QPDFObjectHandle&&) = default; |
| 289 | QPDFObjectHandle& operator=(QPDFObjectHandle&&) = default; | 289 | QPDFObjectHandle& operator=(QPDFObjectHandle&&) = default; |
| 290 | 290 | ||
| 291 | - [[deprecated("use operator bool()")]] inline bool isInitialized() const; | 291 | + // This method is provided for backward compatibility only. New code should convert to bool |
| 292 | + // instead. | ||
| 293 | + inline bool isInitialized() const; | ||
| 292 | 294 | ||
| 293 | // This method returns true if the QPDFObjectHandle objects point to exactly the same underlying | 295 | // This method returns true if the QPDFObjectHandle objects point to exactly the same underlying |
| 294 | // object, meaning that changes to one are reflected in the other, or "if you paint one, the | 296 | // object, meaning that changes to one are reflected in the other, or "if you paint one, the |
| @@ -390,10 +392,10 @@ class QPDFObjectHandle: public qpdf::BaseHandle | @@ -390,10 +392,10 @@ class QPDFObjectHandle: public qpdf::BaseHandle | ||
| 390 | 392 | ||
| 391 | // Construct an object as above by reading from the given InputSource at its current position | 393 | // Construct an object as above by reading from the given InputSource at its current position |
| 392 | // and using the tokenizer you supply. Indirect objects and encrypted strings are permitted. | 394 | // and using the tokenizer you supply. Indirect objects and encrypted strings are permitted. |
| 393 | - // This method was intended to be called by QPDF for parsing objects that are ready from the | ||
| 394 | - // object's input stream. | ||
| 395 | - QPDF_DLL | ||
| 396 | - static QPDFObjectHandle parse( | 395 | + // This method was intended to be called by QPDF for parsing objects that are read from the |
| 396 | + // object's input stream. To be removed in qpdf 13. See | ||
| 397 | + // <https:manual.qpdf.org/release-notes.html#r12-0-0-deprecate>. | ||
| 398 | + [[deprecated("to be removed in qpdf 13")]] QPDF_DLL static QPDFObjectHandle parse( | ||
| 397 | std::shared_ptr<InputSource> input, | 399 | std::shared_ptr<InputSource> input, |
| 398 | std::string const& object_description, | 400 | std::string const& object_description, |
| 399 | QPDFTokenizer&, | 401 | QPDFTokenizer&, |
libqpdf/qpdf/QPDFParser.hh
| @@ -14,6 +14,7 @@ class QPDFParser | @@ -14,6 +14,7 @@ class QPDFParser | ||
| 14 | QPDFParser() = delete; | 14 | QPDFParser() = delete; |
| 15 | 15 | ||
| 16 | // This constructor is only used by QPDFObjectHandle::parse overload taking a QPDFTokenizer. | 16 | // This constructor is only used by QPDFObjectHandle::parse overload taking a QPDFTokenizer. |
| 17 | + // ABI: remove when removing QPDFObjectHandle::parse overload. | ||
| 17 | QPDFParser( | 18 | QPDFParser( |
| 18 | InputSource& input, | 19 | InputSource& input, |
| 19 | std::string const& object_description, | 20 | std::string const& object_description, |
manual/release-notes.rst
| @@ -71,6 +71,7 @@ more detail. | @@ -71,6 +71,7 @@ more detail. | ||
| 71 | If you are relying on them please open a ticket_. | 71 | If you are relying on them please open a ticket_. |
| 72 | 72 | ||
| 73 | - All ``QPDFTokenizer`` push-mode methods. | 73 | - All ``QPDFTokenizer`` push-mode methods. |
| 74 | + - ``QPDFObjectHandle::parse`` overload taking a ``QPDFTokenizer`` parameter. | ||
| 74 | 75 | ||
| 75 | - CLI breaking Changes | 76 | - CLI breaking Changes |
| 76 | 77 |