PHPackages                             discoverygarden/dgi\_image\_discovery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. discoverygarden/dgi\_image\_discovery

ActiveDrupal-module[Image &amp; Media](/categories/media)

discoverygarden/dgi\_image\_discovery
=====================================

v1.6.2(6mo ago)116.4k↓17.3%5[2 PRs](https://github.com/discoverygarden/dgi_image_discovery/pulls)2GPL-3.0-onlyPHP

Since Dec 1Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/discoverygarden/dgi_image_discovery)[ Packagist](https://packagist.org/packages/discoverygarden/dgi_image_discovery)[ RSS](/packages/discoverygarden-dgi-image-discovery/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (24)Used By (2)

DGI Image Discovery
===================

[](#dgi-image-discovery)

Introduction
------------

[](#introduction)

A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use (and cache) the first one found:

- contents of a Media field, `field_representative_image` on the node
- an "Islandora thumbnail", i.e., a media that is "Media of" the node (using `field_media_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to ""
- a first child's Islandora thumbnail media, i.e. the Islandora thumbnail of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3.

Requirements
------------

[](#requirements)

This module requires the following modules/libraries:

- [Islandora](https://github.com/Islandora/islandora/)

Installation
------------

[](#installation)

Install as usual, see [this](https://www.drupal.org/docs/extending-drupal/installing-modules) for further information.

Usage
-----

[](#usage)

This module allows for image discovery on parent aggregate objects such as collections, compounds and paged objects in multiple context.

### Search API

[](#search-api)

Search API can be made to index URLs to the discovered image in multiple ways:

- `deferred`: Create URL to dedicated endpoint which can handle the final image lookup. Given responses here can be aware of Drupal's cache tag invalidations, we can accordingly change what is ultimately served.
- `pre_generated`: Creates URL to styled image directly. May cause stale references to stick in the index, due to changing access control constraints.

This is configurable on the field when it is added to be indexed. Effectively this defaults to `pre_generated` to maintain existing/current behaviour; however, `deferred` should possibly be preferred without other mechanisms to perform bulk reindexing due to changes on other entities. In particular, should there be something such as [Embargo](https://github.com/discoverygarden/embargo) and [Embargo Inheritance](https://github.com/discoverygarden/embargo_inheritance), where an access control statement applied to a parent node is expected to be applied to children. That said, `pre_generated` could be more convenient/efficient when there are no complex access control requirements in play.

#### Deferral mechanism

[](#deferral-mechanism)

There are multiple plugins to dereference deferred URLs:

- `redirect`: Issue a redirect to the final derived image destination from our endpoint. Easily enough done; however:
    - incurs another round trip
    - can cause a race condition if two items being displayed in a set of results happen to reference the same image. Drupal maintains a lock/semaphore around the image derivation: If the second request occurs while the first still has the lock for deriving the image, then the second request will receive an HTTP 503 with `Retry-After` of `3` seconds, but many browsers do not make use of the `Retry-After` header.
- `subrequest`: Perform subrequest to stream the image directly from our endpoint. Can deal with the 503 with `Retry-After`.

The plugin in use is presently controlled with the `DGI_IMAGE_DISCOVERY_DEFERRED_PLUGIN`, which defaults to `subrequest`.

### Views

[](#views)

Views referencing node content can directly make use of a virtual field.

### Adding a "Representative Image" field to your content type

[](#adding-a-representative-image-field-to-your-content-type)

To override the use of the "Islandora" thumbnail, you can add a new field to each of your applicable content types. To do this:

1. In the "Manage fields" page for your content type, choose "Create a new field".
2. In the "Add a new field" list, choose "Media" (if on Drupal &lt; 10.2, this is "Reference &gt; Media")
3. Set the new field's label to "Representative image" so that the machine name of this field is `field_representative_image`. This machine name must be set; you can change the label later if you wish.
4. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1.
5. On the next page, in the "Media type" checkboxes, choose "Image".
6. Click on "Save settings".

If you are adding the field to more than one content type, you should choose "Re-use an existing field" on subsequent content types.

### Adding a "Default Image" Field to Your Content Type

[](#adding-a-default-image-field-to-your-content-type)

This module, through an update hook, will add a field\_default\_image field to the Islandora Models vocabulary.

- Configuring a Default Image for a Content Type
    - Create a media item of type Image to serve as the default image for the required content types.
    - In the Islandora Models vocabulary, select the appropriate default image for each term.

This setup allows the module to associate a default thumbnail (TN) with objects that lack a specific thumbnail for any given content type.

### Using the image in Views

[](#using-the-image-in-views)

When configuring a content view, add and configure the virtual field "DGI Image Discovery Discovered Image".

### Using the image in Content Display

[](#using-the-image-in-content-display)

Under "Manage display" for a content type, you can enable the pseudo-field "DGI Image Discovery Discovered Image".

Troubleshooting/Issues
----------------------

[](#troubleshootingissues)

Having problems or solved a problem? Contact [discoverygarden](http://support.discoverygarden.ca).

Maintainers/Sponsors
--------------------

[](#maintainerssponsors)

Current maintainers:

- [discoverygarden](http://www.discoverygarden.ca)

Development
-----------

[](#development)

If you would like to contribute to this module, create an issue, pull request and/or contact [discoverygarden](http://support.discoverygarden.ca).

License
-------

[](#license)

[GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt)

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance67

Regular maintenance activity

Popularity31

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Recently: every ~74 days

Total

17

Last Release

196d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed79bbc35ed0aaee2f603c6f16885fb01e203941eea0cd63013f9f6185df6c30?d=identicon)[adam-vessey](/maintainers/adam-vessey)

![](https://www.gravatar.com/avatar/49d799e416ff30e90b07d1b7b6a487dfe945ae884c53747de4724439965d7904?d=identicon)[lutaylor](/maintainers/lutaylor)

![](https://www.gravatar.com/avatar/454136e389341c2a9c22dfba3107e09e2f8653807185bb213c5272efa9b93864?d=identicon)[willtp87](/maintainers/willtp87)

---

Top Contributors

[![adam-vessey](https://avatars.githubusercontent.com/u/607975?v=4)](https://github.com/adam-vessey "adam-vessey (39 commits)")[![nchiasson-dgi](https://avatars.githubusercontent.com/u/53783039?v=4)](https://github.com/nchiasson-dgi "nchiasson-dgi (19 commits)")[![prashant-dgi](https://avatars.githubusercontent.com/u/177777443?v=4)](https://github.com/prashant-dgi "prashant-dgi (9 commits)")[![mjordan](https://avatars.githubusercontent.com/u/403918?v=4)](https://github.com/mjordan "mjordan (7 commits)")[![jordandukart](https://avatars.githubusercontent.com/u/1337738?v=4)](https://github.com/jordandukart "jordandukart (6 commits)")[![chrismacdonaldw](https://avatars.githubusercontent.com/u/31731869?v=4)](https://github.com/chrismacdonaldw "chrismacdonaldw (6 commits)")[![rosiel](https://avatars.githubusercontent.com/u/1943338?v=4)](https://github.com/rosiel "rosiel (6 commits)")[![axelerant-hardik](https://avatars.githubusercontent.com/u/142213759?v=4)](https://github.com/axelerant-hardik "axelerant-hardik (5 commits)")[![bibliophileaxe](https://avatars.githubusercontent.com/u/18718388?v=4)](https://github.com/bibliophileaxe "bibliophileaxe (3 commits)")[![willtp87](https://avatars.githubusercontent.com/u/688918?v=4)](https://github.com/willtp87 "willtp87 (2 commits)")[![MorganDawe](https://avatars.githubusercontent.com/u/3580299?v=4)](https://github.com/MorganDawe "MorganDawe (2 commits)")[![JojoVes](https://avatars.githubusercontent.com/u/19390668?v=4)](https://github.com/JojoVes "JojoVes (1 commits)")[![lutaylor](https://avatars.githubusercontent.com/u/2863794?v=4)](https://github.com/lutaylor "lutaylor (1 commits)")[![dynac01](https://avatars.githubusercontent.com/u/29845849?v=4)](https://github.com/dynac01 "dynac01 (1 commits)")[![IAMlKeno](https://avatars.githubusercontent.com/u/22577721?v=4)](https://github.com/IAMlKeno "IAMlKeno (1 commits)")

---

Tags

displaydrupaldrupal-moduleislandora

### Embed Badge

![Health badge](/badges/discoverygarden-dgi-image-discovery/health.svg)

```
[![Health](https://phpackages.com/badges/discoverygarden-dgi-image-discovery/health.svg)](https://phpackages.com/packages/discoverygarden-dgi-image-discovery)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[thunder/thunder-distribution

The thunder distribution

50634.8k3](/packages/thunder-thunder-distribution)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
