Commit ed7f2a6c76cf41956861c7a43f5cd22876230e86

Authored by Jay Berkenbilt
1 parent 2c81eec4

Add smaller image streams file for testing

qpdf/qtest/qpdf.test
... ... @@ -542,6 +542,7 @@ my @json_files = (
542 542 ['page-labels-and-outlines', []],
543 543 ['page-labels-num-tree', []],
544 544 ['image-streams', []],
  545 + ['image-streams-small', []],
545 546 ['field-types', []],
546 547 ['image-streams', ['--decode-level=all']],
547 548 ['image-streams', ['--decode-level=specialized']],
... ... @@ -2105,6 +2106,10 @@ $n_tests += 14;
2105 2106  
2106 2107 # image-streams.pdf is the output of examples/pdf-create.
2107 2108 # examples/pdf-create validates the actual image data.
  2109 +# image-streams-small.pdf was manually created by editing
  2110 +# pdf-create.cc to reduce width and height to 40x8 and ignoring
  2111 +# errors. Its purpose was to get a small file with images with
  2112 +# different filters for fuzz testing.
2108 2113 foreach my $l (qw(none generalized specialized all))
2109 2114 {
2110 2115 $td->runtest("image-streams: $l",
... ...
qpdf/qtest/qpdf/image-streams-small.pdf 0 → 100644
No preview for this file type
qpdf/qtest/qpdf/json-image-streams-small.out 0 → 100644
  1 +{
  2 + "acroform": {
  3 + "fields": [],
  4 + "hasacroform": false,
  5 + "needappearances": false
  6 + },
  7 + "objects": {
  8 + "1 0 R": {
  9 + "/Pages": "2 0 R",
  10 + "/Type": "/Catalog"
  11 + },
  12 + "10 0 R": {
  13 + "/Contents": "27 0 R",
  14 + "/MediaBox": [
  15 + 0,
  16 + 0,
  17 + 612,
  18 + 392
  19 + ],
  20 + "/Parent": "2 0 R",
  21 + "/Resources": {
  22 + "/Font": {
  23 + "/F1": "13 0 R"
  24 + },
  25 + "/ProcSet": [
  26 + "/PDF",
  27 + "/Text",
  28 + "/ImageC"
  29 + ],
  30 + "/XObject": {
  31 + "/Im1": "28 0 R"
  32 + }
  33 + },
  34 + "/Type": "/Page"
  35 + },
  36 + "11 0 R": {
  37 + "/Contents": "29 0 R",
  38 + "/MediaBox": [
  39 + 0,
  40 + 0,
  41 + 612,
  42 + 392
  43 + ],
  44 + "/Parent": "2 0 R",
  45 + "/Resources": {
  46 + "/Font": {
  47 + "/F1": "13 0 R"
  48 + },
  49 + "/ProcSet": [
  50 + "/PDF",
  51 + "/Text",
  52 + "/ImageC"
  53 + ],
  54 + "/XObject": {
  55 + "/Im1": "30 0 R"
  56 + }
  57 + },
  58 + "/Type": "/Page"
  59 + },
  60 + "12 0 R": {
  61 + "/Filter": "/FlateDecode",
  62 + "/Length": 97
  63 + },
  64 + "13 0 R": {
  65 + "/BaseFont": "/Helvetica",
  66 + "/Encoding": "/WinAnsiEncoding",
  67 + "/Name": "/F1",
  68 + "/Subtype": "/Type1",
  69 + "/Type": "/Font"
  70 + },
  71 + "14 0 R": {
  72 + "/BitsPerComponent": 8,
  73 + "/ColorSpace": "/DeviceCMYK",
  74 + "/Filter": "/FlateDecode",
  75 + "/Height": 48,
  76 + "/Length": 51,
  77 + "/Subtype": "/Image",
  78 + "/Type": "/XObject",
  79 + "/Width": 40
  80 + },
  81 + "15 0 R": {
  82 + "/Filter": "/FlateDecode",
  83 + "/Length": 102
  84 + },
  85 + "16 0 R": {
  86 + "/BitsPerComponent": 8,
  87 + "/ColorSpace": "/DeviceCMYK",
  88 + "/Filter": "/DCTDecode",
  89 + "/Height": 48,
  90 + "/Length": 454,
  91 + "/Subtype": "/Image",
  92 + "/Type": "/XObject",
  93 + "/Width": 40
  94 + },
  95 + "17 0 R": {
  96 + "/Filter": "/FlateDecode",
  97 + "/Length": 108
  98 + },
  99 + "18 0 R": {
  100 + "/BitsPerComponent": 8,
  101 + "/ColorSpace": "/DeviceCMYK",
  102 + "/Filter": "/RunLengthDecode",
  103 + "/Height": 48,
  104 + "/Length": 7688,
  105 + "/Subtype": "/Image",
  106 + "/Type": "/XObject",
  107 + "/Width": 40
  108 + },
  109 + "19 0 R": {
  110 + "/Filter": "/FlateDecode",
  111 + "/Length": 96
  112 + },
  113 + "2 0 R": {
  114 + "/Count": 9,
  115 + "/Kids": [
  116 + "3 0 R",
  117 + "4 0 R",
  118 + "5 0 R",
  119 + "6 0 R",
  120 + "7 0 R",
  121 + "8 0 R",
  122 + "9 0 R",
  123 + "10 0 R",
  124 + "11 0 R"
  125 + ],
  126 + "/Type": "/Pages"
  127 + },
  128 + "20 0 R": {
  129 + "/BitsPerComponent": 8,
  130 + "/ColorSpace": "/DeviceRGB",
  131 + "/Filter": "/FlateDecode",
  132 + "/Height": 48,
  133 + "/Length": 46,
  134 + "/Subtype": "/Image",
  135 + "/Type": "/XObject",
  136 + "/Width": 40
  137 + },
  138 + "21 0 R": {
  139 + "/Filter": "/FlateDecode",
  140 + "/Length": 99
  141 + },
  142 + "22 0 R": {
  143 + "/BitsPerComponent": 8,
  144 + "/ColorSpace": "/DeviceRGB",
  145 + "/Filter": "/DCTDecode",
  146 + "/Height": 48,
  147 + "/Length": 849,
  148 + "/Subtype": "/Image",
  149 + "/Type": "/XObject",
  150 + "/Width": 40
  151 + },
  152 + "23 0 R": {
  153 + "/Filter": "/FlateDecode",
  154 + "/Length": 106
  155 + },
  156 + "24 0 R": {
  157 + "/BitsPerComponent": 8,
  158 + "/ColorSpace": "/DeviceRGB",
  159 + "/Filter": "/RunLengthDecode",
  160 + "/Height": 48,
  161 + "/Length": 6411,
  162 + "/Subtype": "/Image",
  163 + "/Type": "/XObject",
  164 + "/Width": 40
  165 + },
  166 + "25 0 R": {
  167 + "/Filter": "/FlateDecode",
  168 + "/Length": 97
  169 + },
  170 + "26 0 R": {
  171 + "/BitsPerComponent": 8,
  172 + "/ColorSpace": "/DeviceGray",
  173 + "/Filter": "/FlateDecode",
  174 + "/Height": 48,
  175 + "/Length": 36,
  176 + "/Subtype": "/Image",
  177 + "/Type": "/XObject",
  178 + "/Width": 40
  179 + },
  180 + "27 0 R": {
  181 + "/Filter": "/FlateDecode",
  182 + "/Length": 101
  183 + },
  184 + "28 0 R": {
  185 + "/BitsPerComponent": 8,
  186 + "/ColorSpace": "/DeviceGray",
  187 + "/Filter": "/DCTDecode",
  188 + "/Height": 48,
  189 + "/Length": 359,
  190 + "/Subtype": "/Image",
  191 + "/Type": "/XObject",
  192 + "/Width": 40
  193 + },
  194 + "29 0 R": {
  195 + "/Filter": "/FlateDecode",
  196 + "/Length": 108
  197 + },
  198 + "3 0 R": {
  199 + "/Contents": "12 0 R",
  200 + "/MediaBox": [
  201 + 0,
  202 + 0,
  203 + 612,
  204 + 392
  205 + ],
  206 + "/Parent": "2 0 R",
  207 + "/Resources": {
  208 + "/Font": {
  209 + "/F1": "13 0 R"
  210 + },
  211 + "/ProcSet": [
  212 + "/PDF",
  213 + "/Text",
  214 + "/ImageC"
  215 + ],
  216 + "/XObject": {
  217 + "/Im1": "14 0 R"
  218 + }
  219 + },
  220 + "/Type": "/Page"
  221 + },
  222 + "30 0 R": {
  223 + "/BitsPerComponent": 8,
  224 + "/ColorSpace": "/DeviceGray",
  225 + "/Filter": "/RunLengthDecode",
  226 + "/Height": 48,
  227 + "/Length": 37,
  228 + "/Subtype": "/Image",
  229 + "/Type": "/XObject",
  230 + "/Width": 40
  231 + },
  232 + "4 0 R": {
  233 + "/Contents": "15 0 R",
  234 + "/MediaBox": [
  235 + 0,
  236 + 0,
  237 + 612,
  238 + 392
  239 + ],
  240 + "/Parent": "2 0 R",
  241 + "/Resources": {
  242 + "/Font": {
  243 + "/F1": "13 0 R"
  244 + },
  245 + "/ProcSet": [
  246 + "/PDF",
  247 + "/Text",
  248 + "/ImageC"
  249 + ],
  250 + "/XObject": {
  251 + "/Im1": "16 0 R"
  252 + }
  253 + },
  254 + "/Type": "/Page"
  255 + },
  256 + "5 0 R": {
  257 + "/Contents": "17 0 R",
  258 + "/MediaBox": [
  259 + 0,
  260 + 0,
  261 + 612,
  262 + 392
  263 + ],
  264 + "/Parent": "2 0 R",
  265 + "/Resources": {
  266 + "/Font": {
  267 + "/F1": "13 0 R"
  268 + },
  269 + "/ProcSet": [
  270 + "/PDF",
  271 + "/Text",
  272 + "/ImageC"
  273 + ],
  274 + "/XObject": {
  275 + "/Im1": "18 0 R"
  276 + }
  277 + },
  278 + "/Type": "/Page"
  279 + },
  280 + "6 0 R": {
  281 + "/Contents": "19 0 R",
  282 + "/MediaBox": [
  283 + 0,
  284 + 0,
  285 + 612,
  286 + 392
  287 + ],
  288 + "/Parent": "2 0 R",
  289 + "/Resources": {
  290 + "/Font": {
  291 + "/F1": "13 0 R"
  292 + },
  293 + "/ProcSet": [
  294 + "/PDF",
  295 + "/Text",
  296 + "/ImageC"
  297 + ],
  298 + "/XObject": {
  299 + "/Im1": "20 0 R"
  300 + }
  301 + },
  302 + "/Type": "/Page"
  303 + },
  304 + "7 0 R": {
  305 + "/Contents": "21 0 R",
  306 + "/MediaBox": [
  307 + 0,
  308 + 0,
  309 + 612,
  310 + 392
  311 + ],
  312 + "/Parent": "2 0 R",
  313 + "/Resources": {
  314 + "/Font": {
  315 + "/F1": "13 0 R"
  316 + },
  317 + "/ProcSet": [
  318 + "/PDF",
  319 + "/Text",
  320 + "/ImageC"
  321 + ],
  322 + "/XObject": {
  323 + "/Im1": "22 0 R"
  324 + }
  325 + },
  326 + "/Type": "/Page"
  327 + },
  328 + "8 0 R": {
  329 + "/Contents": "23 0 R",
  330 + "/MediaBox": [
  331 + 0,
  332 + 0,
  333 + 612,
  334 + 392
  335 + ],
  336 + "/Parent": "2 0 R",
  337 + "/Resources": {
  338 + "/Font": {
  339 + "/F1": "13 0 R"
  340 + },
  341 + "/ProcSet": [
  342 + "/PDF",
  343 + "/Text",
  344 + "/ImageC"
  345 + ],
  346 + "/XObject": {
  347 + "/Im1": "24 0 R"
  348 + }
  349 + },
  350 + "/Type": "/Page"
  351 + },
  352 + "9 0 R": {
  353 + "/Contents": "25 0 R",
  354 + "/MediaBox": [
  355 + 0,
  356 + 0,
  357 + 612,
  358 + 392
  359 + ],
  360 + "/Parent": "2 0 R",
  361 + "/Resources": {
  362 + "/Font": {
  363 + "/F1": "13 0 R"
  364 + },
  365 + "/ProcSet": [
  366 + "/PDF",
  367 + "/Text",
  368 + "/ImageC"
  369 + ],
  370 + "/XObject": {
  371 + "/Im1": "26 0 R"
  372 + }
  373 + },
  374 + "/Type": "/Page"
  375 + },
  376 + "trailer": {
  377 + "/ID": [
  378 + "Z§¯•Py»’~’46\u001dı\u0011¢",
  379 + "Z§¯•Py»’~’46\u001dı\u0011¢"
  380 + ],
  381 + "/Root": "1 0 R",
  382 + "/Size": 31
  383 + }
  384 + },
  385 + "outlines": [],
  386 + "pagelabels": [],
  387 + "pages": [
  388 + {
  389 + "contents": [
  390 + "12 0 R"
  391 + ],
  392 + "images": [
  393 + {
  394 + "bitspercomponent": 8,
  395 + "colorspace": "/DeviceCMYK",
  396 + "decodeparms": [
  397 + null
  398 + ],
  399 + "filter": [
  400 + "/FlateDecode"
  401 + ],
  402 + "filterable": true,
  403 + "height": 48,
  404 + "name": "/Im1",
  405 + "object": "14 0 R",
  406 + "width": 40
  407 + }
  408 + ],
  409 + "label": null,
  410 + "object": "3 0 R",
  411 + "outlines": [],
  412 + "pageposfrom1": 1
  413 + },
  414 + {
  415 + "contents": [
  416 + "15 0 R"
  417 + ],
  418 + "images": [
  419 + {
  420 + "bitspercomponent": 8,
  421 + "colorspace": "/DeviceCMYK",
  422 + "decodeparms": [
  423 + null
  424 + ],
  425 + "filter": [
  426 + "/DCTDecode"
  427 + ],
  428 + "filterable": false,
  429 + "height": 48,
  430 + "name": "/Im1",
  431 + "object": "16 0 R",
  432 + "width": 40
  433 + }
  434 + ],
  435 + "label": null,
  436 + "object": "4 0 R",
  437 + "outlines": [],
  438 + "pageposfrom1": 2
  439 + },
  440 + {
  441 + "contents": [
  442 + "17 0 R"
  443 + ],
  444 + "images": [
  445 + {
  446 + "bitspercomponent": 8,
  447 + "colorspace": "/DeviceCMYK",
  448 + "decodeparms": [
  449 + null
  450 + ],
  451 + "filter": [
  452 + "/RunLengthDecode"
  453 + ],
  454 + "filterable": false,
  455 + "height": 48,
  456 + "name": "/Im1",
  457 + "object": "18 0 R",
  458 + "width": 40
  459 + }
  460 + ],
  461 + "label": null,
  462 + "object": "5 0 R",
  463 + "outlines": [],
  464 + "pageposfrom1": 3
  465 + },
  466 + {
  467 + "contents": [
  468 + "19 0 R"
  469 + ],
  470 + "images": [
  471 + {
  472 + "bitspercomponent": 8,
  473 + "colorspace": "/DeviceRGB",
  474 + "decodeparms": [
  475 + null
  476 + ],
  477 + "filter": [
  478 + "/FlateDecode"
  479 + ],
  480 + "filterable": true,
  481 + "height": 48,
  482 + "name": "/Im1",
  483 + "object": "20 0 R",
  484 + "width": 40
  485 + }
  486 + ],
  487 + "label": null,
  488 + "object": "6 0 R",
  489 + "outlines": [],
  490 + "pageposfrom1": 4
  491 + },
  492 + {
  493 + "contents": [
  494 + "21 0 R"
  495 + ],
  496 + "images": [
  497 + {
  498 + "bitspercomponent": 8,
  499 + "colorspace": "/DeviceRGB",
  500 + "decodeparms": [
  501 + null
  502 + ],
  503 + "filter": [
  504 + "/DCTDecode"
  505 + ],
  506 + "filterable": false,
  507 + "height": 48,
  508 + "name": "/Im1",
  509 + "object": "22 0 R",
  510 + "width": 40
  511 + }
  512 + ],
  513 + "label": null,
  514 + "object": "7 0 R",
  515 + "outlines": [],
  516 + "pageposfrom1": 5
  517 + },
  518 + {
  519 + "contents": [
  520 + "23 0 R"
  521 + ],
  522 + "images": [
  523 + {
  524 + "bitspercomponent": 8,
  525 + "colorspace": "/DeviceRGB",
  526 + "decodeparms": [
  527 + null
  528 + ],
  529 + "filter": [
  530 + "/RunLengthDecode"
  531 + ],
  532 + "filterable": false,
  533 + "height": 48,
  534 + "name": "/Im1",
  535 + "object": "24 0 R",
  536 + "width": 40
  537 + }
  538 + ],
  539 + "label": null,
  540 + "object": "8 0 R",
  541 + "outlines": [],
  542 + "pageposfrom1": 6
  543 + },
  544 + {
  545 + "contents": [
  546 + "25 0 R"
  547 + ],
  548 + "images": [
  549 + {
  550 + "bitspercomponent": 8,
  551 + "colorspace": "/DeviceGray",
  552 + "decodeparms": [
  553 + null
  554 + ],
  555 + "filter": [
  556 + "/FlateDecode"
  557 + ],
  558 + "filterable": true,
  559 + "height": 48,
  560 + "name": "/Im1",
  561 + "object": "26 0 R",
  562 + "width": 40
  563 + }
  564 + ],
  565 + "label": null,
  566 + "object": "9 0 R",
  567 + "outlines": [],
  568 + "pageposfrom1": 7
  569 + },
  570 + {
  571 + "contents": [
  572 + "27 0 R"
  573 + ],
  574 + "images": [
  575 + {
  576 + "bitspercomponent": 8,
  577 + "colorspace": "/DeviceGray",
  578 + "decodeparms": [
  579 + null
  580 + ],
  581 + "filter": [
  582 + "/DCTDecode"
  583 + ],
  584 + "filterable": false,
  585 + "height": 48,
  586 + "name": "/Im1",
  587 + "object": "28 0 R",
  588 + "width": 40
  589 + }
  590 + ],
  591 + "label": null,
  592 + "object": "10 0 R",
  593 + "outlines": [],
  594 + "pageposfrom1": 8
  595 + },
  596 + {
  597 + "contents": [
  598 + "29 0 R"
  599 + ],
  600 + "images": [
  601 + {
  602 + "bitspercomponent": 8,
  603 + "colorspace": "/DeviceGray",
  604 + "decodeparms": [
  605 + null
  606 + ],
  607 + "filter": [
  608 + "/RunLengthDecode"
  609 + ],
  610 + "filterable": false,
  611 + "height": 48,
  612 + "name": "/Im1",
  613 + "object": "30 0 R",
  614 + "width": 40
  615 + }
  616 + ],
  617 + "label": null,
  618 + "object": "11 0 R",
  619 + "outlines": [],
  620 + "pageposfrom1": 9
  621 + }
  622 + ],
  623 + "parameters": {
  624 + "decodelevel": "generalized"
  625 + },
  626 + "version": 1
  627 +}
... ...