Skip to content

Image processor fails silently when ImageMagick is installed but not in library path #632

@spilth

Description

@spilth

Describe the bug

Even though the invenio-cli check-requirements task passes successfully, when I upload images to a local Invenio RDM instance on macOS they do not result in any canvas entries in the IIIF manifest. This seems to be happening because ImageMagick is failing to load due to not being in any library paths.

Steps to Reproduce

  1. Create a vanilla Invenio RDM 12 app
  2. Start the application in service/run mode on macOS (not containerized)
  3. Create a record with an image upload
  4. Publish the record
  5. View the records API endpoint
  6. Click on the IIIF Manifest link
  7. See an empty canvas array

Expected behavior

  • Canvas entries are generated

Additional context

This is happening on macOS with ImageMagick installed via Homebrew.

Once I add the following to my shell init script, it's able to find ImageMagick:

export MAGICK_HOME="/opt/homebrew/opt/imagemagick"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib:$DYLD_LIBRARY_PATH"
export PATH="$MAGICK_HOME/bin:$PATH"
export PKG_CONFIG_PATH="$MAGICK_HOME/lib/pkgconfig:$PKG_CONFIG_PATH"

I confirmed this by running the following code from the image processor:

import pkg_resources
pkg_resources.get_distribution("wand")
from wand.image import Image

Without the paths set above, I get the following:

OSError: cannot find library; tried paths: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions