Skip to content

Instantly share code, notes, and snippets.

View ahankinson's full-sized avatar

Andrew Hankinson ahankinson

View GitHub Profile
import logging
log = logging.getLogger(__name__)
def get_dimensions(img_path: str) -> Tuple[int, int]:
"""
Returns a tuple (w, h) of an image with a given ID. Reads the w/h data directly
from the JPEG 2000 header.
:param img_path: a path to a JPEG 2000 image