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
{
"@context":[
"http://www.w3.org/ns/anno.jsonld",
"http://iiif.io/api/presentation/3/context.json"
],
"type":"Manifest",
"id":"http://dlib.indiana.edu/iiif_av/lunchroom_manners/lunchroom_manners.v6",
"label":{
"en":[
"Etude in F Minor"