{"id":24093279,"url":"https://github.com/umd-lib/image-fetcher","last_synced_at":"2026-05-14T15:36:19.226Z","repository":{"id":147002845,"uuid":"592949399","full_name":"umd-lib/image-fetcher","owner":"umd-lib","description":"Utilities to fetch images stored in Fedora through the IIIF Image API","archived":false,"fork":false,"pushed_at":"2026-04-15T23:59:17.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-16T01:26:20.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umd-lib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-24T21:55:18.000Z","updated_at":"2026-04-15T23:59:22.000Z","dependencies_parsed_at":"2025-02-27T11:07:22.648Z","dependency_job_id":"db47c23c-f57b-4ec0-9e0a-1fe1b5009f19","html_url":"https://github.com/umd-lib/image-fetcher","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/umd-lib/image-fetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fimage-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fimage-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fimage-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fimage-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umd-lib","download_url":"https://codeload.github.com/umd-lib/image-fetcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fimage-fetcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33031307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T09:27:01.926Z","updated_at":"2026-05-14T15:36:19.221Z","avatar_url":"https://github.com/umd-lib.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-fetcher\n\nUtilities to fetch images stored in Fedora through the IIIF Image API\n\n## Why?\n\nThe initial use-case for these utilities was to pre-warm a Cantaloupe IIIF Image Server\nimage cache with images retrieved from a Fedora 4 repository. Pre-warming was required\nbecause the network retrieval speed for large images from Fedora 4 is not fast enough\nto provide a smooth user experience when viewing them in a IIIF Image Viewer.\n\n## Quick Start\n\n```bash\ngit clone git@github.com:umd-lib/image-fetcher.git\ncd image-fetcher\npyenv install -s $(cat .python-version)\npython -m venv .venv\npip install -e .\n\n# configuration is done through environment variables\nexport REPO_ENDPOINT=https://fcrepo-qa.lib.umd.edu/fcrepo/rest\nexport IIIF_IMAGE_ENDPOINT=https://iiif-qa.lib.umd.edu/images/iiif/2/\nexport STOMP_SERVER=127.0.0.1:63613\n\n# pre-fetch an image directly\nimage-fetch {FCREPO_URI}\n\n# start the STOMP listener in the background\n# and write the log file to image-fetch.log\nimage-fetch-listen 2\u003e image-fetch.log \u0026\n\n# send a message to request a pre-fetch\nimage-fetch-send {FCREPO_URI}\n```\n\n## Utilities\n\n### image-fetch\n\nDirectly fetch zero or more images via IIIF based on their Fedora URI.\n\n### image-fetch-listen\n\nListen for requests to fetch an image via IIIF based on its Fedora URI.\nConnects to a STOMP server host and port (`STOMP_SERVER`; e.g., `localhost:61613`)\nand listens on a queue (`IMAGES_QUEUE`; default is `/queue/images`) for messages\nwith a Fedora URI in a specific header (`URI_HEADER_NAME`; default is `CamelFcrepoUri`).\n\nWhen it receives such a message, it translates that URI to a IIIF Image URI,\nand requests that new URI.\n\nIf there are any problems processing the message (e.g., a bad URI, network error,\netc.), the listener forwards the message to an error queue (`IMAGES_ERROR_QUEUE`;\ndefault is `/queue/images.errors`). It also adds the headers `Error` (containing\nthe exception message) and `original-destination` (the original queue that this\nwas delivered to).\n\n### image-fetch-send\n\nSend zero or more requests to fetch an image to the `IMAGES_QUEUE` on `STOMP_SERVER`.\n\nEach URI given on the command line generates its own message.\n\n## Configuration\n\nConfiguration of the utilities is done through environment variables:\n\n| Name                 | Required | Default Value          |\n|----------------------|----------|------------------------|\n| `REPO_ENDPOINT_URI`  | **Yes**  |                        |\n| `IIIF_BASE_URI`      | **Yes**  |                        |\n| `STOMP_SERVER`       | **Yes**  |                        |\n| `LOG_LEVEL`          | No       | `INFO`                 |\n| `URI_HEADER_NAME`    | No       | `CamelFcrepoUri`       |\n| `IMAGES_QUEUE`       | No       | `/queue/images`        |\n| `IMAGES_ERROR_QUEUE` | No       | `/queue/images.errors` |\n\nThese can either be specified in the environment itself or via a `.env` file.\n\n## Testing\n\nTests are written using the [pytest] framework. To install the testing\ndependencies, run:\n\n```bash\npip install -e . --group test\n```\n\nThen run the test suite:\n\n```bash\npytest\n```\n\nTo include a test coverage report (using the [pytest-cov] plugin):\n\n```bash\npytest --cov-report=term-missing --cov=src\n```\n\n## Docker Images\n\nThis repository contains a multi-target [Dockerfile](Dockerfile) that can\nbuild Docker images for each of the three [utilities](#utilities) described\nabove.\n\n```bash\ndocker build -t docker.lib.umd.edu/image-fetch --target image-fetch .\n```\n\n```bash\ndocker build -t docker.lib.umd.edu/image-fetch-send --target image-fetch-send .\n```\n\n```bash\ndocker build -t docker.lib.umd.edu/image-fetch-listen --target image-fetch-listen .\n```\n\nWhen using these images, you will need to use the appropriate method to pass\nenvironment variables to the running containers (e.g., the `--env` and/or\n`--env-file` flags of `docker run`, or the `environment` section of a Docker\nCompose file).\n\n[pytest]: https://docs.pytest.org/en/7.2.x/\n[pytest-cov]: https://pytest-cov.readthedocs.io/en/latest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fimage-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumd-lib%2Fimage-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fimage-fetcher/lists"}