Coders, filters and configuration paths

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
redserpent7
Posts: 10
Joined: 2016-01-19T08:15:42-07:00
Authentication code: 1151

Coders, filters and configuration paths

Post by redserpent7 » 2017-12-05T07:18:05-07:00

Hi,

I am trying to bundle ImageMagick 7 in an AWS lambda function. I build ImageMagick from source with support for jpeg, png, webp, tiff, openjp2 and jbig. The library compiled fine and both magick and identify worked with no issues.

I copied the binaries, libraries along with the coders, filters and configuration xml files each to its own directory, packaged them all in my lambda function zip archive.

I then set the environment variables for each path from the AWS lambda console as such:

MAGICK_CODER_FILTER_PATH => /var/task/imagemagick/filters
MAGICK_CODER_MODULE_PATH => /var/task/imagemagick/coders
MAGICK_CONFIGURE_PATH => /var/task/imagemagick/config
LD_LIBRARY_PATH => /var/task/imagemagick/lib

I can verify that each of the directories mentioned above do exist on the lambda function environment as I started listing the files inside each one of those directories and indeed they are there with all their files.


Then I tried to execute this simple command

Code: Select all

/var/task/imagemagick/bin/magick /tmp/1.jpg /tmp/1.png
[/b] and I got the following:

Code: Select all

magick: unable to load module '/var/task/imagemagick/coders/jpeg.la': file not found @ error/module.c/OpenModule/1275.
magick: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/509.
I tried running

Code: Select all

ls -la /var/task/imagemagick/coders/jpeg.la
from the code and indeed the file does exist:

Code: Select all

-rwxrwxr-x 1 ec2-user ec2-user 1055 Dec  5 11:24 /var/task/imagemagick/coders/jpeg.la
What am I missing here?

snibgo
Posts: 10958
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Coders, filters and configuration paths

Post by snibgo » 2017-12-05T07:58:48-07:00

I know nothing about "AWS lambda function". Is it a permissions problem?
snibgo's IM pages: im.snibgo.com

redserpent7
Posts: 10
Joined: 2016-01-19T08:15:42-07:00
Authentication code: 1151

Re: Coders, filters and configuration paths

Post by redserpent7 » 2017-12-05T08:34:26-07:00

snibgo wrote:
2017-12-05T07:58:48-07:00
I know nothing about "AWS lambda function". Is it a permissions problem?
I don't think its a permission problem. I opened a linux EC2 instance and copied the package binaries, libs and files. set the environment variables as mentioned in the original post and I get the same error. As for AWS Lambda, you can think of it as a container if you will.

Post Reply