Logo white

OpenSystemsDevelopment / qpdf

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Commits 4,691
  • Compare
  • Branches 1
  • Tags 0
  • qpdf
08 May, 2022
6 commits
  • Implement JSON v2 output
    c76536dd
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »
  • Apply script across future v2 test files ...
    bdfc4da5
    There is one unexpected pass in this commit. This script was applied
    to the files changed in this commit:
    
    ----------
    #!/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())
        data['version'] = 2
        objectinfo = {}
        if 'objectinfo' in data:
            objectinfo = data['objectinfo']
            del data['objectinfo']
        if 'objects' not in data:
            continue
        qpdf = {'jsonversion': 2, 'pdfversion': '1.3', 'objects': {}}
        for k, v in data['objects'].items():
            is_stream = objectinfo.get(k, {}).get('stream', {}).get('is', False)
            if k.endswith(' R'):
                k = 'obj:' + k
            if is_stream:
                v = {'stream': {'dict': v}}
            else:
                v = {'value': v}
            qpdf['objects'][k] = v
        data['qpdf'] = qpdf
        del data['objects']
    print(json_dumps(data))
    ----------
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »
  • Prepare test suite for json v2
    8d348974
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »
  • Fix typo in json output key name ...
    15272662
    moddify -> modify. Also carefully spell checked all remaining keys by
    splitting them into words and running a spell checker, not just
    relying on visual proofreading. That was the only one.
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »
  • Implement JSON v2 for Stream ...
    1bc8abfd
    Not fully exercised in this commit
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »
  • Implement JSON v2 for String ...
    3246923c
    Also refine the herustic for deciding whether to use hexadecimal
    notation for a string.
    Jay Berkenbilt authored
    2022-05-08 13:45:20 -0400  
    Browse Code »

07 May, 2022
11 commits
  • Prepare code for JSON v2 ...
    16f4f94c
    Update getJSON() methods and calls to them
    Jay Berkenbilt authored
    2022-05-07 11:12:01 -0400  
    Browse Code »
  • Objectinfo json: write incrementally and in numeric order ...
    a9fbbd5d
    This script was used on test data:
    
    ----------
    #!/usr/bin/env python3
    import json
    import sys
    import re
    
    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())
        if 'objectinfo' not in data:
            continue
        trailer = None
        to_sort = []
        for k, v in data['objectinfo'].items():
            if k == 'trailer':
                trailer = v
            else:
                m = re.match(r'^(\d+) \d+ R', k)
                if m:
                    to_sort.append([int(m.group(1)), k, v])
        newobjectinfo = {x[1]: x[2] for x in sorted(to_sort)}
        if trailer is not None:
            newobjectinfo['trailer'] = trailer
        data['objectinfo'] = newobjectinfo
    print(json_dumps(data))
    ----------
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Objects json: write incrementally and in numeric order ...
    948de609
    The following script was used to adjust test data:
    
    ----------
    #!/usr/bin/env python3
    import json
    import sys
    import re
    
    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())
        if 'objects' not in data:
            continue
        trailer = None
        to_sort = []
        for k, v in data['objects'].items():
            if k == 'trailer':
                trailer = v
            else:
                m = re.match(r'^(\d+) \d+ R', k)
                if m:
                    to_sort.append([int(m.group(1)), k, v])
        newobjects = {x[1]: x[2] for x in sorted(to_sort)}
        if trailer is not None:
            newobjects['trailer'] = trailer
        data['objects'] = newobjects
    print(json_dumps(data))
    ----------
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Pages json: write each page incrementally
    f50274ef
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Make JSON::writeNext public
    1615d7fe
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Top-level json: write incrementally ...
    dc9b7287
    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))
    ----------
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Test json against schema only on demand ...
    7f65a5c2
    Testing json against schema requires an in-memory copy, so do it only
    when requested by the test suite.
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Add next to Pl_String and fix comments
    a3c99803
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • Add --test-json-schema command-line option
    b361c5ce
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • QPDFJob: have doJSON write to a pipeline
    7604ac5c
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »
  • TODO: solidify remaining json v2 work
    2a92b1b0
    Jay Berkenbilt authored
    2022-05-07 08:26:31 -0400  
    Browse Code »

06 May, 2022
1 commit
  • JSON: add blob type that generates base64-encoded binary data
    0500d434
    Jay Berkenbilt authored
    2022-05-06 19:14:52 -0400  
    Browse Code »

04 May, 2022
5 commits
  • Change JSON parser to parse from an InputSource
    05fda4af
    Jay Berkenbilt authored
    2022-05-04 12:07:11 -0400  
    Browse Code »
  • Add new FileInputSource constructors
    e5f3910c
    Jay Berkenbilt authored
    2022-05-04 12:07:11 -0400  
    Browse Code »
  • JSON: add write methods and implement unparse() in terms of those
    e2596359
    Jay Berkenbilt authored
    2022-05-04 12:07:11 -0400  
    Browse Code »
  • Make "objects" and "pages" consistent in JSON output
    8b25de24
    Jay Berkenbilt authored
    2022-05-04 08:32:44 -0400  
    Browse Code »
  • Don't call pushInheritedAttributesToPage in json mode ...
    6b576797
    We used to have to do that, but for quite some time, the code that
    gets images has no longer required it.
    Jay Berkenbilt authored
    2022-05-04 07:11:13 -0400  
    Browse Code »

03 May, 2022
14 commits
  • Add new Pl_String Pipeline
    f4206a09
    Jay Berkenbilt authored
    2022-05-03 18:54:51 -0400  
    Browse Code »
  • Add new Pl_OStream Pipeline
    16139d97
    Jay Berkenbilt authored
    2022-05-03 18:54:51 -0400  
    Browse Code »
  • Make use of the new Pipeline methods in some places
    21d6e323
    Jay Berkenbilt authored
    2022-05-03 18:31:23 -0400  
    Browse Code »
  • Add new Pipeline convenience methods
    f1c6bb97
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Make Pipeline::write take an unsigned char const* (API change)
    59f3e09e
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Spell check with newer cSpell
    d55c7ac5
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Make assert handling less error-prone ...
    62bf296a
    Prevent my future self or other contributors from using assert in
    tests and then having that assert not do anything because of the
    NDEBUG macro.
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Remove remaining incorrect assert calls from implementation
    92b69246
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • TODO note about test suites
    b20f0519
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Add internal Pl_Base64 ...
    3d9bac43
    Bidirectional base64; will be used by JSON v2.
    Jay Berkenbilt authored
    2022-05-03 18:31:22 -0400  
    Browse Code »
  • Make sure building docs updates job.sums if needed
    f07284da
    Jay Berkenbilt authored
    2022-05-03 08:39:50 -0400  
    Browse Code »
  • Move generate_auto_job to the top-level CMakeLists.txt
    6724a362
    Jay Berkenbilt authored
    2022-05-03 08:39:50 -0400  
    Browse Code »
  • TODO: more JSON notes
    7882b85b
    Jay Berkenbilt authored
    2022-05-03 08:39:50 -0400  
    Browse Code »
  • TODO: JSON notes
    3c4d2bfb
    Jay Berkenbilt authored
    2022-05-03 08:39:50 -0400  
    Browse Code »

01 May, 2022
3 commits
  • Add reactors to the JSON parser
    8d2a0eda
    Jay Berkenbilt authored
    2022-05-01 19:55:52 -0400  
    Browse Code »
  • Windows perl workaround
    f5dd6381
    Jay Berkenbilt authored
    2022-05-01 19:55:52 -0400  
    Browse Code »
  • qtest: don't run coverage when TESTS is given
    ab01045b
    Jay Berkenbilt authored
    2022-05-01 13:25:51 -0400  
    Browse Code »