2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-28 07:53:11 +00:00
qpdf/qpdf/qtest/qpdf/optimize-images-min-width-json.out
Jay Berkenbilt dc9b7287cd Top-level json: write incrementally
This commit just changes the order in which fields are written to the
json without changing their content. All the json files in the test
suite were modified with this script to ensure that we didn't get any
changes other than ordering.

----------
#!/usr/bin/env python3
import json
import sys

def json_dumps(data):
    return json.dumps(data, ensure_ascii=False,
                      indent=2, separators=(',', ': '))

for filename in sys.argv[1:]:
    with open(filename, 'r') as f:
        data = json.loads(f.read())
    newdata = {}
    for i in ('version', 'parameters', 'pages', 'pagelabels',
              'acroform', 'attachments', 'encrypt', 'outlines',
              'objects', 'objectinfo'):
        if i in data:
            newdata[i] = data[i]
print(json_dumps(newdata))
----------
2022-05-07 08:26:31 -04:00

65 lines
1.3 KiB
Plaintext

{
"version": 1,
"parameters": {
"decodelevel": "generalized"
},
"pages": [
{
"contents": [
"4 0 R"
],
"images": [
{
"bitspercomponent": 8,
"colorspace": "/DeviceGray",
"decodeparms": [
null
],
"filter": [
"/FlateDecode"
],
"filterable": true,
"height": 200,
"name": "/Im1",
"object": "6 0 R",
"width": 100
},
{
"bitspercomponent": 8,
"colorspace": "/DeviceGray",
"decodeparms": [
null
],
"filter": [
"/DCTDecode"
],
"filterable": false,
"height": 100,
"name": "/Im2",
"object": "7 0 R",
"width": 200
},
{
"bitspercomponent": 8,
"colorspace": "/DeviceGray",
"decodeparms": [
null
],
"filter": [
"/FlateDecode"
],
"filterable": true,
"height": 200,
"name": "/Im3",
"object": "8 0 R",
"width": 200
}
],
"label": null,
"object": "3 0 R",
"outlines": [],
"pageposfrom1": 1
}
]
}