Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: PDF 2.0 header detection #964

Open
wants to merge 4 commits into
base: dev/1.33
Choose a base branch
from
Open

Commits on Aug 8, 2024

  1. FEAT: PDF v2.0 support

    - added second signature for PDF-2 style header (this can be improved);
    - added support for PDF-2 headers to `PdfHeader`; and
    - more work required on valid major/minor version combinations.
    carlwilson committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    5b9b80d View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. Configuration menu
    Copy the full SHA
    6d4a085 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. FEAT: PDF 2.0 header detection

    - refactored `PDF-hul` PDF Header parsing, particularly the version parsing;
      - no more `null` return handling, specific exceptions are thrown instead;
      - these are caught and handled in the `PdfModule` class;
      - new `PdfVersion` class to handle version parsing and comparison;
      - PDF version detection now handled by pattern match, with better reporting of errors;
      - offsets added to `PdfException`s that were in the scope of refactoring;
      - added new `%PDF-2.` signature to the `PDF-hul` module;
    - new `edu.harvard.hul.ois.jhove.messages.JhoveMessages.getMessageInstance` convenience method to clone message with sub-message;
    - added two new test cases to `PDF-hul` regression tests for header version detection;
    - added necessary `sed` insertions and file copies to handle changed integration test results to `jhove-bbt/scripts/create-1.33-target.sh`; and
    - refactored "not found" reporting for modules and handlers in jhove-apps `edu.harvard.hul.ois.jhove.Jhove` class.
    
    Error messages changed to give more detailed information:
    
    - `PDF-HUL-137`:
    - `PDF-HUL-148`: No longer mentions specific minor versions but has a more detailed sub-message
    - `PDF-HUL-155`: Reports the header that was too short
    
    New Error Messages:
    
    - `PDF-HUL-160`: IOException reading PDF header
    - `PDF-HUL-161`: PDF major version number should be 1.x or 2.x
    - `PDF-HUL-162`: Malformed PDF version number
    carlwilson committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    bd0f9e6 View commit details
    Browse the repository at this point in the history
  2. FIX: Codacy static QA issues

    - moved field declarations.
    carlwilson committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    11b1f30 View commit details
    Browse the repository at this point in the history