Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Change imagick configuration to allow pdf processing#225

Merged
ildyria merged 3 commits intomasterfrom
imagick-config
May 13, 2025
Merged

Change imagick configuration to allow pdf processing#225
ildyria merged 3 commits intomasterfrom
imagick-config

Conversation

@ildyria
Copy link
Copy Markdown
Member

@ildyria ildyria commented May 12, 2025

This pull request introduces changes to the Dockerfile to enhance support for handling PDF files with ImageMagick and includes the addition of a new dependency. The key updates involve configuring ImageMagick's policy settings and adding Ghostscript for improved PDF processing.

ImageMagick Configuration Updates:

  • Added a new ARG IMAGEMAGIC_CONFIG to specify the path to the ImageMagick policy file (/etc/ImageMagick-6/policy.xml). This allows for dynamic configuration of ImageMagick policies.
  • Updated the RUN command to modify the ImageMagick policy file, enabling read|write rights for PDF processing. A fallback message is added if the policy file is not found.

Dependency Additions:

  • Added ghostscript to the list of installed packages to support PDF-related operations.

@ildyria ildyria requested a review from Copilot May 12, 2025 09:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates the Dockerfile to enable PDF processing with ImageMagick by modifying its policy file and adding necessary dependencies.

  • Added an ARG for the ImageMagick policy configuration file.
  • Modified the policy file using sed to change PDF processing rights.
  • Added ghostscript to support PDF processing.
Comments suppressed due to low confidence (1)

Dockerfile:22

  • [nitpick] Consider renaming the variable 'IMAGEMAGIC_CONFIG' to 'IMAGEMAGICK_CONFIG' for clarity and consistency with the official ImageMagick spelling.
ARG IMAGEMAGIC_CONFIG=/etc/ImageMagick-6/policy.xml

@ildyria
Copy link
Copy Markdown
Member Author

ildyria commented May 12, 2025

@mitpjones ping! :)

Copy link
Copy Markdown
Contributor

@d7415 d7415 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the (apparently dumb) default makes sense. I don't know why that would need to be variable though?

Comment thread Dockerfile Outdated
ARG BRANCH=master

# https://stackoverflow.com/questions/53377176/change-imagemagick-policy-on-a-dockerfile
ARG IMAGEMAGIC_CONFIG=/etc/ImageMagick-6/policy.xml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we need this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Dockerfile Outdated
ildyria and others added 2 commits May 12, 2025 22:36
Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com>
@ildyria ildyria requested a review from d7415 May 12, 2025 20:38
@ildyria ildyria merged commit 61d1eea into master May 13, 2025
1 check passed
@ildyria ildyria deleted the imagick-config branch May 13, 2025 06:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants