Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend houdini to accept a new header X-Islandora-Input-Args which ca… #172

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

jasonhildebrand
Copy link

@jasonhildebrand jasonhildebrand commented Oct 20, 2022

Related PRs:

What does this Pull Request do?

I wanted to use the "density" parameter in imagemagick, but this parameter only works if applied BEFORE the input stream. According to the man page (https://manpages.ubuntu.com/manpages/trusty/man1/convert.im6.1.html) there are several options which are only valid as so-called "input options".

This PR extends houdini to accept these input parameters via a new header, X-Islandora-Input-Args. I also increased debug logging to include all headers passed to houdini, and fixed a small existing bug in the log output ($args was intended to be $content_types).

What's new?

Houdini now accepts and uses this new header if present. The header is not required; houdini still functions as before if it is not present.

How should this be tested?

A description of what steps someone could take to:

With isle-dc, I find it fairly easy to test by spinning up houdini (running an existing image), and adding a volume mapping to map the new houdini code into the container like so:

  houdini:
    volumes:
      - ../../../Crayfish/Houdini/src:/var/www/crayfish/Houdini/src:delegated

Then test using CURL by executing this command (needs to be updated for your current Bearer value and a valid resource URL). Execute it from within the drupal container:

curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NjYyODA4OTAsImV4cCI6MTY2NjI4ODA5MCwid2ViaWQiOiIxIiwiaXNzIjoiaHR0cHM6XC9cL2lzbGFuZG9yYS50cmFlZmlrLm1lIiwic3ViIjoiYWRtaW4iLCJyb2xlcyI6WyJhdXRoZW50aWNhdGVkIiwiYWRtaW5pc3RyYXRvciIsImZlZG9yYWFkbWluIl0sImF1ZCI6WyJpc2xhbmRvcmEiXX0.MEnrsE5IVwhCcnWu3hn32pJnSaDs6xTMpKQscm-NewmpyinuqNKUX6fvjO0UM-2xgeaWNFo8pU7EpX30oIkHjovl9iHD7TLED46EEwAUYHcjleGDMjnOAGWCbRzHM4S-4XznWBiJOfh9oMnkZabU1yhpLA5xHsw_MU9oTInHqR4bcQZx545gzxsiqkkzuib_CuOi4uYpSpfVP1ZJ0nh-pNWY2JYAaAhDls0PUuHTM51TJ8Om1kGRDNojPFTHJtipCnnu4k7_SeJ3VQWWDB-M1xwR-if-QOcebEnVdIUyKgM9-0PKlIU9ghE6Knjw8pkiO3OwTxms_oBKMfnBlonnCQ" -H "Apix-Ldp-Resource: https://islandora.traefik.me/_flysystem/fedora/2022-10/1915-2-9-page1.pdf" -H "Accept: image/jpeg"  -H "x-islandora-input-args: -density 288" "x-islandora-args: -unsharp 0x.75" --output out.jpg houdini:8000/convert

Confirm by checking the houdini logs to see that the input-args were included in the convert command line.

Additional Notes:

I have made corresponding changes in Islandora (to add this field to Generate Derivative actions), and to Alpaca (to pass the parameter through as the new header) - these PRs are linked above.

Any additional information that you think would be helpful when reviewing this PR.

Interested parties

I haven't discussed this with anyone yet - not sure if anyone else needs this or not, but it seems like a good general improvement. @Islandora/8-x-committers

@jasonhildebrand
Copy link
Author

Please let me know if this needs to be re-rolled against 3.x. I'm currently using 2.x, so that was easiest to use in development/testing.

…n contain additional command line parameters to be applied BEFORE the input stream. Update and fix small bug in log output.
@jasonhildebrand jasonhildebrand changed the base branch from 2.x to 4.x August 22, 2024 15:49
@jasonhildebrand
Copy link
Author

Updated for 4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant