Skip to main content

jp2_remediator

PyPI version

A Python module to validate jp2 images:

  • reads the bytes of a jp2 file or directory of files or S3 bucket
  • looks for presence of ICC profile
  • maps and validates curv values according to the ISO/IEC 15444-1:2019 (E) and ICC.1:2022 Specifications
  • corrects values where the rTRC/gTRC/bTRC tag size in the Tag table structure (ICC.1:2022 Table 24 tag size) is not the same as the count value (gamma, where n == 1) in the curveType encoding (ICC.1:2022 Table 35, n value)
  • flag and (optionally) log values where the count value n != 1 for future review

jp2_remediator on PyPI

Installation

pip install jp2_remediator
python3 -m pip install jp2_remediator

pip install jp2_remediator==NN.NN.NN (version number)

Usage

python3 src/jp2_remediator/main.py  -h

usage: main.py [-h] {file,directory,bucket} ...

JP2 file processor

options:
  -h, --help            show this help message and exit

Input source:
  {file,directory,bucket}
    file                Process a single JP2 file
    directory           Process all JP2 files in a directory
    bucket              Process all JP2 files in an S3 bucket

Process one file

python3 src/jp2_remediator/main.py file tests/test-images/7514499.jp2

python3 src/jp2_remediator/main.py file tests/test-images/481014278.jp2

Process directory

python3 src/jp2_remediator/main.py directory tests/test-images/

Process all .jp2 files in an S3 bucket:

python3 src/jp2_remediator/main.py bucket remediation-folder

Process only files with a specific prefix (folder):

python3 src/jp2_remediator/main.py bucket remediation-folder --prefix testbatch_20240923`

Run tests

Run integration tests

pytest src/jp2_remediator/tests/integration/

Run unit tests

pytest src/jp2_remediator/tests/unit/

Docker environment

Build Docker image

./bin/docker-build.sh

Run Docker container as executable

./bin/docker-run.sh -h

Development environment

uv sync
export PYTHONPATH="${PYTHONPATH}:src"

uv run python src/jp2_remediator/main.py -h

Publishing to PyPI

Add the following variable to your .env:

UV_PUBLISH_TOKEN=pypi-<token>

Set the version number in pyproject.toml to the version you wish to publish.

Run the following commands:

rm -rf dist/
uv build
uv publish

If you get a publish error, the following commands will set your .env variables into the shell and should work:

set -a
source .env
set +a
uv publish

Metadata

Release files for jp2_remediator 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jp2_remediator 1.2.2
File Size Uploaded Provenance Actions
jp2_remediator-1.2.2.tar.gz 22.7 kB Without provenance Details for jp2_remediator-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jp2_remediator 1.2.2
File Interpreter ABI Platform Actions
jp2_remediator-1.2.2-py3-none-any.whl Python 3 none any Details for jp2_remediator-1.2.2-py3-none-any.whl

Total release size: 49.9 kB

Release files / jp2_remediator-1.2.2.tar.gz

Download URL jp2_remediator-1.2.2.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1be097d80288493b7114d759f4b85344f8fb5ae02a236aeabf80cc5f0d0b96cf
BLAKE2b-256 checksum
How to use checksums
a86fc6cd9948947c9ac98d185f016179d088615a61e1b73a75830b4f44732d77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / jp2_remediator-1.2.2-py3-none-any.whl

Download URL jp2_remediator-1.2.2-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4efb5bea85ab1b583584f1d6214a90fd4feb42e5e961ac4eddd21f66a426338
BLAKE2b-256 checksum
How to use checksums
86b9ab3dc9be3ccf2ec2f124301743d3d4eaa9a821bb6d9e1772e3c5d2112f48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for jp2_remediator 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page