Skip to content

Image

arkindex_worker.worker.image

ElementsWorker methods for images.

Classes

ImageMixin

Functions
create_iiif_url
create_iiif_url(url: str) -> Image

Create an image from an existing IIIF image by URL. The URL should be of the image’s identifier, not of its Image Information request (/info.json).

Parameters:

Name Type Description Default
url str

URL of the image.

required

Returns:

Type Description
Image

The created image.

Source code in arkindex_worker/worker/image.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
def create_iiif_url(self, url: str) -> Image:
    """
    Create an image from an existing IIIF image by URL.
    The URL should be of the image's identifier, not of its Image Information request (`/info.json`).

    :param url: URL of the image.
    :returns: The created image.
    """
    assert url and isinstance(
        url, str
    ), "url shouldn't be null and should be of type str"

    return Image(self.api_client.request("CreateIIIFURL", body={"url": url}))